I am trying to convert PDF's pages to PNG images but getting an exception at
"pngDevice.Process(pdfDocument.Pages(pageCount), imageStream)" line with message "Parameter is not Valid".
I am Converting DOCX and DOC file to PDF and then each page of PDF to PNG images.
While converting some DOCX file containing headers & footers, tables especially images (copied screenshot or inserted pictures) am getting an exception.
While debugging I found out it process the pages which does not have a picture and was converted to PDF from DOCX file. The code executes fine if the original file extension is DOC before converting to PDF and then converting to PNG images.
I do pass LoadOptions object with appropriate format while loading the document into Aspose.Words.Document (not sure if it matters) object and saving it with below code:
Aspose.Words.Document document = new Aspose.Words.Document(filePath, docLoadOptions);
document.Save(tempFolder + "filename.pdf", Aspose.Words.SaveFormat.Pdf);
Where am I going wrong, or is there any limitation of converting from DOCX to PDF causing this error.
Though it is a requirement to have it converted to PDF first then to PNG images it will be nice to know how to convert each page of DOC/DOCX to PNG. I have tried document.save() method but it only converts the first page to PNG.
See attachad pdf document.