Free Support Forum - aspose.com

Docx to pdf conversion failed on certain cases

Hello,

Our application is mainly used for counting pages of docx files and then convert it to pdf. We have a case where the page count is not correct and the pdf generated by Aspose is not correct as well, 6 pages instead of 3. I can give the docx file for investigation if needed.

Is there some known cases where the conversion is failing ?

Regards.

@rolandpdoc,

Thanks for your inquiry. Please ZIP and upload your input Word document and corresponding output PDF file showing the undesired behavior here for testing. We will investigate the issue on our end and provide you more information.

Archive.zip (50.3 KB)

Here they are

@rolandpdoc,

We have converted your Word document to PDF by using the licensed version of Aspose.Words for Java 18.5 on our end (see awjava-18.5.pdf (82.2 KB)). It says that there are 5 pages.

However, MS Word 2016 on our Windows 10 environment says that there are 4 pages in this DOCX file (see screenshot).

What version of MS Word are you using on your end? Can you please also “Save As” this “860_Medical Resume.docx” document to PDF by using MS Word on your end and share the MS Word generated PDF file here for further testing?

I did some new tests with this file.

Actually, the output using Word is not the same between versions. I tested with 2011 on Mac, 2016 on Mac and 365 on Windows. I got 3 different outputs… The best one seems to be 2011 on Mac.

In any case, I can not incriminate Aspose for this, it is more a problem of the docx itself.

I think that we can close the ticket unless you want to do some more testing.

@rolandpdoc,

You may try using the CompatibilityOptions.OptimizeFor method that allows to optimize the document contents as well as default Aspose.Words behavior to a particular versions of MS Word. e.g.

doc.CompatibilityOptions.OptimizeFor(Aspose.Words.Settings.MsWordVersion.Word2016);

In case you have any further inquiries or need any help, please let us know.