Hi. I want to create an image file of a PDF page, but with some PDF files, all I get is a blank image. The image is the correct size, but it is just white. With other PDF files, the output image is fine. What can I do to ensure I always get a good image?
I am using the following code to generate the image. I have attached an example PDF and example Visual Studio solution.
var pdfDocument = new Document(@"..\..\OnePagePdf.pdf");
var pngDevice = new PngDevice(new Resolution(200));
using (var fileStream = File.Open(@"..\..\OnePagePdf.png", FileMode.Create))
{
pngDevice.Process(pdfDocument.Pages[1], fileStream);
}
Thanks for your help.