We are trying to migrate our project from Windows to Linux Containers and we came across an issue where given all the same parameters and same file, different PNG images are being generated on Windows and on Linux when using PngDevice.Process().
The interesting part is that the final PDF document that is generated on both OS’s looks identical but there is also a difference when comparing bytes. That is not really an issue to us since the final PDF looks identical, however the PNG images being generated on Linux look different and far worse than the ones generated on Windows. This is an issue since we display these PNGs to customers as they manipulate the document. This difference in images is more obvious when the document is zoomed in and everything appears more bold from Linux.
Please see the small sample project I’ve created with an included PDF document that reproduces this issue. Simply take the project, restore dependencies, and run on Windows, and then do the same on Linux to see the difference in outputs.
Another issue with this difference in output is that the images generated on Linux end up being 2.5X bigger while still being the same resolution as the ones generated on Windows.
I believe this is a bug and any help or work arounds to make the PNG image look the same is appreciated. I have already tried increasing the resolution on the PngDevice to 400 which makes it looks pretty similar but still lower quality than on Windows, and this increases the file size from 200kb on Windows to 1500kb on Linux which isn’t sustainable.
Also the only fonts being used in this document are the following, and I’ve made sure Microsoft’s TrueType fonts are installed in the Linux Container.
1-linux-output.png (510.8 KB)
1-windows-output.png (213.8 KB)
png diff.png (10.8 KB)
comparing-windows-linux.zip (250.6 KB)