Search code examples
c#nreco

The ScaleTo parameter behaviour in the NReco.PdfRenderer.PdfToImageConverter in Windows


I'm trying to render a scaled image using the code:

new PdfToImageConverter
{
    ScaleTo = 2200
}
.GenerateImage(
    "sample.pdf",
    1,
    ImageFormat.Png,
    "sample.pdf.png");

The code renders a good proportional image under Ubuntu, but a squared image under Windows.

The squared window has a white field:

enter image description here

Sample application: https://github.com/sergei-voronkov/Test.NReco.ScaleTo

Also, the generated image is correct if I try to generate it using native poppler utility pdftoppm.exe under Windows:

pdftoppm.exe -png -aa yes -aaVector yes  -f 1 -l 1 -singlefile  -scale-to 2200 sample.pdf sample.pdf

The command line generates a proportional scaled image:

enter image description here


Solution

  • The problem has been fixed in the version 1.5.0.