Issue with PDF Generation in Docker Container Using Flying Saucer

38 views
Skip to first unread message

Saksham Kumar

unread,
Sep 6, 2024, 6:08:22 AM9/6/24
to Flying Saucer Users
Hi Flying Saucer Team,

I am currently using the Flying Saucer library version
org.xhtmlrenderer:flying-saucer-pdf:9.9.0
in a Java 17 environment. While I am able to successfully generate PDFs on my local Windows machine, I am encountering an issue when generating the same PDFs within a Docker container running on a Linux environment.

Specifically, the PDFs are being created, but the content is unexpectedly split across two pages. Some of the content that fits on a single page in the local environment is moving to the second page in the Docker container. I have not made any changes to the configurations between the two environments, and I am unable to determine the cause of this discrepancy.

Could you please provide any insights or suggestions on why this might be happening and how I can resolve this issue? Any guidance or recommendations would be greatly appreciated.

Thank you for your assistance.

Best regards,
Saksham Kumar
Error.png

Neil Morrison

unread,
Sep 7, 2024, 12:18:25 AM9/7/24
to flying-sa...@googlegroups.com
Could it relate to the fonts you're using? Container likely won't have same fonts (if any) versus running locally

N

--
You received this message because you are subscribed to the Google Groups "Flying Saucer Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flying-saucer-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flying-saucer-users/5cd9c8f3-b043-4e1b-889c-6cf1a5c6e253n%40googlegroups.com.

Christophe Marchand

unread,
Sep 9, 2024, 6:23:23 AM9/9/24
to flying-sa...@googlegroups.com
You probably have different system configurations regarding locale, and so default page sizes, etc...

Check that you have a @page directive in your CSS, check that you've explicitly defined fonts, and that they are available in your docker image.

Hope that helps,
Christophe

--

Saksham Kumar

unread,
Sep 10, 2024, 2:29:18 AM9/10/24
to Flying Saucer Users
working by using this @page directive in my CSS file

Thanks
Reply all
Reply to author
Forward
0 new messages