Aspose Words for Java - problem in converting to PDF

Hi,

We are trying to convert some docx files whih have comments on page. After converting PDF document has extra spaces on top and bottom of all pages.

We also tried the Aspose’s online tool to convert the sample file and it converts with different output. It adds spaces if there are comments on page and no spaces are added if there are no comments on page.

I am attaching sample docx file with converted files (Using online tool and using code below:

String sourceFile = "spacingtest.docx";
String destFile = sourceFile + ".pdf";
com.aspose.words.Document doc = new com.aspose.words.Document(sourceFile);
PdfSaveOptions pdfOptions = new PdfSaveOptions();
pdfOptions.setCompliance(PdfCompliance.PDF_15);
doc.save(destFile, pdfOptions);

Please suggest how to fix this issue.

spacingtest.zip (48.6 KB)

@sachin1988,

But, we have converted (Save As) your ‘spacingtest.docx’ to PDF by using MS Word 2016 on our end and found that MS Word 2016 generated output is similar to what Aspose.Words produces (see msw-2016.pdf (46.9 KB)).

So, this seems to be an expected behavior as Aspose.Words mimics the behavior of MS Word. If we can help you with anything else, please feel free to ask.