Hi,
I’m trying to convert a Word file to Pdf, but with this specific file, my code crashes when I want to get the PageCount of a document.
A test file is attached
This is my code:
Document document = new Document(inputFileName);
// it crashes on document.PageCount
ConvertEventArgs convertEventArgs = new ConvertEventArgs(0, document.PageCount);
Aspose.Words.Saving.PdfSaveOptions pdfOptions = new Aspose.Words.Saving.PdfSaveOptions();
string outputFileName = "output.pdf";
pdfOptions.PageIndex = 0;
pdfOptions.PageCount = document.PageCount;
document.Save(outputFileName, pdfOptions);
Can anyone please tell me if I’m doing something wrong?
Sincerely,
Geert-Jan Smulders