I have an Asp 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.
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.
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