Skip to content

x and y dpi ignores the set value #75

@sarmad99

Description

@sarmad99

I am using the latest NuGet GhostScript and I am facing this issue:

            string outputFolder = @"C:\Users";
             string inputFile = @"C:\"
             var xDpi = 300; //set the x DPI
              var yDpi = 300; //set the y DPI
            var pageNumber = 1; // the pages in a PDF document
(var rasterizer = new GhostscriptRasterizer()) //create an instance for GhostscriptRasterizer
            {
        rasterizer.Open(inputFile); //opens the PDF file for rasterizing

              //set the output image(png's) complete path
         var outputPNGPath = Path.Combine(outputFolder, string.Format("0.png"));

           //converts the PDF pages to png's 
              var pdf2PNG = rasterizer.GetPage(xDpi, yDpi, pageNumber);

              //save the png's
         pdf2PNG.Save(outputPNGPath, ImageFormat.Png);

         Console.WriteLine("Saved " + outputPNGPath);

              }

pdf2png vertical and horizontal resolution always default to 96 or 120

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions