Am 09.06.2017 um 09:51 schrieb Uwe Möser:
I made a small project which creates 32 pdfs with PDFBox and iText.
The output is:
Time elapsed PDFBox: 2521 msec. (2305msec loading)
Time elapsed iText: 661 msec.
It is possible to improve the load function?
It is possible to create a template document before the loop?
Tested with PDFBox 2.0.6 and iText 2.1.7.
Thanks for your code!
The profiler pointed me to a close(), which did a compress and was
called from the TrueTypeEmbedder constructor... The whole (!) font is
written into the /FontFile2 stream before being replaced by the
subsetted font when saving. This was used for the "old" embedding but is
irrelevant for the subset embedding.
After fixing this pdfbox is much faster, even faster than itext 2.1.7
although slower than the current itext version.
Further work in
https://issues.apache.org/jira/browse/PDFBOX-3824
Tilman
PS: I initially thought it would be faster by using a file as input for
parse() but the program crashed. I found out that this had worked in
2.0.0, but it was even slower than reading from a stream. So that's
another thing to work on.