I am attempting to convert a pdf document to images using ghostscript. The desired dpi is set to 72px which should be high enough for text to display clear but most of the text is illegible.
I can raise the dpi but that will cause very large image files which I would prefer not to have.
I know there are arguments for ghostscript to add anti aliasing etc (e.g. -dDOINTERPOLATE). How do I add them to the following piece of code, or is there a better way to do this?
int desired_x_dpi = 72;
int desired_y_dpi = 72;
GhostscriptRasterizer _rasterizer = new GhostscriptRasterizer();
_rasterizer.Open(inputPdfPath, localDllInfo, false);
for (int pageNumber = 1; pageNumber <= _rasterizer.PageCount; pageNumber++)
{
string pageFilePath = Path.Combine(outputPath, "Page-" + pageNumber.ToString() + ".png");
Image img = _rasterizer.GetPage(desired_x_dpi, desired_y_dpi, pageNumber);
img.Save(pageFilePath, ImageFormat.Png);
}