New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDF make takes 50seconds to print document with one image and 75 tables #798
Comments
Version 0.1.22 includes fix for performance from issue #280. I do not know how large is your document. Partially should reduce time to generate document from previous version pdfmake. It is possible that your document contains a performance problem about which we know nothing yet. |
Hi @liborm85 , my document size is around 75-100 pages one containing image and rest containing tables. I tried to use the new version 0.1.22 but it was slower than the 0.1.20. I tried to use this in 0.1.20 |
My document containes dynamically generated tables from json. |
There was one thing that I noticed was if the document was 40pages, it was printing in 3seconds, but as soon as it became 44pages, it took 23seconds. Is there any method that is having restriction or something? |
@jthoenes Any help or input that you could share?? |
Pdfmake 0.1.22+ use the newer lodash 4.17.2 and not only that (see 91be970). Maybe it has some influence on it. |
Ok sir, but what is the actual relation of number of pages? how can increase in one page degrade the performance? |
I do not know. Maybe someone else comes up with an idea to solve this problem. |
What browser are you having these issues in? If you're using IE11 you will have to make sure to polyfill the |
@Dannybrown2710 Have you tried your code in another browser? Is it equally slow in e.g. Chrome? If not, it's probably the missing constant in IE11 as I mentioned. Try polyfilling it yourself or use a service like polyfill.io to do it. |
Released version does not use a constant (webpack replacer: Line 46 in 98ab6a3
|
Aha! Then I'm clueless. |
@Dannybrown2710 I haven't really done any other changes that should affect performance, but I'm using the code found here: https://github.com/Bazze/pdfmake/tree/feature/wide-tables-without-filesaver-2093de79 On that branch I've implemented a feature which splits tables that becomes wider than the page width plus that I've removed the bundled FileSaver since I include it separately on a global scope. |
@Bazze I have tried your file , its amazing. I just have a small doubt, is it possible to fit one table in one page without getting it cropped? Auto-sizing , or something? |
I'm not sure if I understand you @Dannybrown2710 but if you set your column widths to We're kind of getting off topic in this issue, are you still having the performance issues? |
@Bazze the height is what I am talking about. |
@Dannybrown2710 Alright, I'm not sure about the height since that haven't been an issue for my use case. Maybe the Regarding the performance issues you probably need to get some profiling done in IE to narrow down where the issue resides. |
We also face some performance issues for out HTML to PDF parser. The HTML to Json document which works for PDFmake works in less than seconds, but the actual PDF generation consumes quite some time. On a beefy machine, creating 20 Pages takes on average 10 seconds in latest chrome and PdfMake 1.24 firefox usually needs 21 seconds for the same document. I gonna paste our JSON string we use for testing somewhere. there is also the whole Roboto-font in Base64 included. |
I used definition from previous post and I did some performance tests. I tried different versions of pdfkit.
According to this table must have a performance problem especially with pdfkit. |
I added tests for Edge and IE to the table. |
I'm created issue in pdfkit - foliojs/pdfkit#615 |
Merged a performance optimization for kerning in fontkit. foliojs/fontkit#70 Please re-install and try again. |
New tests:
Test scripts: @devongovett Generate PDF file is faster, but still slow compared to pdfkit version 0.7.1. Another idea for fix? |
Hi @liborm85 what are the main differences between version 0.8.0 and 0.7.1 ? I'm thinking about going back ... I'll use the library included in the zip you just posted. |
Hi @awoywood Library in zip with pdfkit 0.7.1 to generate basic texts works, but fails many tests. It is not intended for everyday use. I hope that @devongovett will solve the performance problem. |
Released new version (0.1.27) with fontkit 1.5.4 which contanins this partly performance fix. |
Just implemented a cache around fontkit in PDFKit: foliojs/pdfkit@6e9e58f. This should improve performance significantly. It is released in PDFKit v0.8.2. In order to increase cache efficiency, it splits up text by words and makes a separate fontkit call for each one, then caches the results. Please let me know if you see any bugs because of that. Particularly, any fonts with GSUB or GPOS adjustments around space characters won't be triggered anymore, though this should be rare. |
New tests:
Test scripts: @devongovett Great work. Thanks. |
New version pdfmake 0.1.29 with new pdfkit released. |
Performance problem solved. |
Thanks all for the fix! 👍 |
Hi @bpampuch I am facing issue in generating document through PDFmake. I tried switching to new version i.e 0.1.22 but still its way slow. Can I get any resolution or answer to this issue?
Thanks in advance
The text was updated successfully, but these errors were encountered: