Using the two last versions of Aspose Words 14.5.0 and 14.6.0, when converting a word document like the attatched to a pdf document it does not respects identation when is in the same line.
Please see the attached documents where the docx is the orignal and the pdf is the result. In the result you can se that the last paragraph the word “NOT APPLICABLE” appears toghether with the rest of the text and the original this word is idented.
The code to convert to PDF is the following:
com.aspose.words.Document doc;
try
{
doc = new com.aspose.words.Document(inStream);
doc.unprotect();
PdfSaveOptions options = new PdfSaveOptions();
options.setSaveFormat(SaveFormat.PDF);
// options.setImageCompression()
options.setPrettyFormat(true);
doc.save(outFolder + newName, options);
}
catch (Exception e)
{
log.error(e);
SystemException se = new SystemException();
se.getErrorMap().put("exception.service.errorconvertingdoc", Arrays.asList(e.getMessage()));
throw se;
}
I have tested the scenario and have managed to reproduce the same issue at my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-10420. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.
I am afraid this issue WORDSNET-10420 has now been postponed till a later date due to some other important issues and new features. We will inform you as soon as there are any further developments.
Thanks for your patience. The issue (WORDSNET-10420) has been fixed in the latest version of Aspose.Words for Java 18.9. Please download it from following link. Download Aspose.Words for Java 18.9