You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We use library FlyingSaucer which in turn uses OpenPDF 1.3.30.
We have a bunch of unit-tests that generate PDFs.
But every run of such a test takes 4+ seconds which is very slow and annoying.
Solution
I found that the problem is how class com.lowagie.text.pdf.BaseFont loads bytes from a jar.
Wrapping InputStream into BufferInputStream makes it much faster.
I am going to submit a pull request soon.
To Reproduce
To reproduce the issue, run the following code.
NB! Don't run it as a part of "OpenPDF" project.
Run it from a separate project. Then CJK fonts are loaded from JAR (openpdf-1.3.30.jar), and such loading is very slow.
Describe the bug
We use library FlyingSaucer which in turn uses OpenPDF 1.3.30.
We have a bunch of unit-tests that generate PDFs.
But every run of such a test takes 4+ seconds which is very slow and annoying.
Solution
I found that the problem is how class
com.lowagie.text.pdf.BaseFont
loads bytes from a jar.Wrapping
InputStream
intoBufferInputStream
makes it much faster.I am going to submit a pull request soon.
To Reproduce
To reproduce the issue, run the following code.
NB! Don't run it as a part of "OpenPDF" project.
Run it from a separate project. Then CJK fonts are loaded from JAR (
openpdf-1.3.30.jar
), and such loading is very slow.Expected behavior
We expect our unit-test to run very quickly (in a few milliseconds), not in 4+ seconds.
The text was updated successfully, but these errors were encountered: