Burn faster PDF files with tcpdf

I created PDF files with tcpdf using writeHTML. What I do, I write completely html code and after that I create pdf files with writeHTML.

My problem is that it is very slow. Creating 5 pages of data table (5 columns x 12 rows per page) takes about 10 seconds.

I followed almost all the instructions from here: http://www.tcpdf.org/performances.php . I put

$pdf->setFontSubsetting(false) ; 

Do you have any other tips? Will it be faster if I generate problematic PDF files?

+4
source share
1 answer

HTML generation, allowing TCPDF to parse this HTML code and rewrite it in a Postscript instruction, and then write this Postscript, of course, will be slower than directly writing Postscript to begin with. Use regular Ln , Cell , Write , etc. Methods for directly creating a PDF file if you want maximum performance. Yes, it's a bit more complicated than writing HTML, but that's because they are different. And the slow part is the translation between these different things.

+4
source

Source: https://habr.com/ru/post/1441483/


All Articles