0

I have an Asp.net MVC 4.6 project. I use the Evo PDF dll to convert HTML strings to PDF files. It works fine locally, as expected. But when I run the app in a Windows Docker Container, the PDF content generated in the container is deformed.

To simplify the issue, I try this simple html string: "<p><b>Yes, Hello World</b></p><p>From EVO PDF !</p>"

HtmlToPdfConverter converter = new HtmlToPdfConverter();
byte[] htmlToPdfBuffer = converter.ConvertHtml("<p><b>Yes, Hello World</b></p><p>From EVO PDF !</p>", null);
System.IO.File.WriteAllBytes("HtmlToPdf.pdf", htmlToPdfBuffer);

This is the result in local: Generated in local

And in container: Container

I tried the latest version of EVO Pdf. same issue.

0

1 Answer 1

0

Most likely, the reason is that the Windows image is missing fonts necessary for this conversion. You can check how to add fonts to Windows containers here: https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/font-packages

answered Feb 10, 2025 at 16:46
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.