Not converting Word document

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

Hi Rogger,
Thanks for your request. I cannot reproduce the problem on my side. I used the latest version of Aspose.Words for testing. You can download the latest version from here:
https://releases.aspose.com/words/net
Best regards,

Check. You guys already fixed it

Sorry for bringing it up before checking the latest version.

Sincerely,

Geert-Jan