-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Possible bug in Flying Saucers 'Graphics2DRenderer' #63
Comments
Hi @skjardenCode I have not deleted the image output code as at some point we may want to get it working again. As for your bug, it may be related to encoding or fonts. I'd recommend keep using flying saucer for image output if possible. |
… as a smoke test and also render PNGs for each PDF written. This allows to compare what features are missing in the Java2D side.
… as a smoke test and also render PNGs for each PDF written. This allows to compare what features are missing in the Java2D side.
Closed in favor of #73 |
Hi Daniel,
thanks a lot for your ongoing efforts on this helpful project!
We recently came up with the use case to render a certain small HTML to an image before we render it to PDF. As OpenHtmlToPdf is based on Flying Saucer, we tried to use the
com.openhtmltopdf.simple.Graphics2DRenderer
class to do so, which should be an easy task.Unfortunately (using Java 6 and Windows 10 with the latest OpenHtmlToPdf version available in Maven Central), the image output of
Graphics2DRenderer
yield wrong results, mainly what seems like an encoding problem.Please, see the following simple example code:
The image you get (trying to render the word "Moonbase") is the following:
We than integrated the latest Flying Saucer version into our project, next to OpenHtmlToPdf, and just changed the line
to
so the example code is using the
Graphics2DRenderer
from the latest Flying Saucer lib ('flying-saucer-core-9.1.1.jar').Running the code again we get the following image:
Which is the expected result.
This seems to be a bug in Flying Saucer. Making it short, I have two questions:
Which Flying Saucer version is OpenHtmlToPdf based on?
Is it possible that you update the Flying Saucer code to fix the above bug (if it IS a bug)?
Thanks a lot!
The text was updated successfully, but these errors were encountered: