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".
Background:
I am Converting DOCX and DOC file to PDF and then each page of PDF to PNG images.
Fails at:
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);
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.
I am trying to convert PDF’s pages to PNG images but getting an exception at<o:p></o:p>
“pngDevice.Process(pdfDocument.Pages(pageCount), imageStream)” line with message “Parameter is not Valid”.<o:p></o:p>
Background:<o:p></o:p>
I am Converting DOCX and DOC file to PDF and then each page of PDF to PNG images.<o:p></o:p>
Fails at:<o:p></o:p>
While converting some DOCX file containing headers & footers, tables especially images (copied screenshot or inserted pictures) am getting an exception.<o:p></o:p>
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.<o:p></o:p>
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:<o:p></o:p>
Aspose.Words.Document document = new Aspose.Words.Document(filePath, docLoadOptions);<o:p></o:p>
Where am I going wrong, or is there any limitation of converting from DOCX to PDF causing this error.
Hi Manmeet,
Thanks for using our products.
I
have tested the scenario using Aspose.Pdf for .NET 7.3.0 and I am getting Out of Memory error when trying to convert PDF pages into PNG format. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-34305. We
will investigate this issue in details and will keep you updated on the status
of a correction.
We
apologize for your inconvenience.
Manmeet:
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.
Concerning to this issue, I am moving this thread to respective forum where my fellow workers taking care of Aspose.Words for .NET would be in better position to answer this query.
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.
Please use the following code snippet to convert each page of a Word document into a PNG image and read following documentation of links for your kind reference.
The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan