Retain Paragraph Spacing SpaceAfter & SpaceBefore Values during processing WPS Office Documents using Java API over MacOS

Mac OS 10.15.2
java version “1.8.0_181”
Java™ SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot™ 64-Bit Server VM (build 25.181-b13, mixed mode)
Aspose: aspose-words-19.12 (390.3 KB)

Document document = new Document("input docx");
PdfSaveOptions saveOptions = new PdfSaveOptions();"output pdf", saveOptions);
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions();
saveOptions.setSaveFormat(SaveFormat.DOCX);"output docx", saveOptions);

the orginal file , Paragraph space after is 0 viewed by wps & words ,
when read to document object and loop all paragraph , space after return 10 (error)
and also just export to pdf or docx , paragraph space become 10 too.


Please check if the following code produces correct results on your end?

LoadOptions lo = new LoadOptions();

Document doc = new Document("E:\\Temp\\error_space_size\\input.docx", lo);"E:\\Temp\\error_space_size\\19.12-lo.docx"); 

In case the problem still remains, please also convert your input.docx to PDF format by using MS Word and WPS Office and attach the generated PDF files here for further testing. Thanks for your cooperation.

with custom loadoption space after return 8 (still error)
correct_out_by_wps.pdf (307.0 KB)


For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-19745. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

2 posts were split to a new topic: Retain Watermark Angle & Convert WPS Office Document to PDF using Java API over MacOS


Regarding WORDSNET-19745, please also share a screenshot of your “Office Language Preferences” dialog. We found recently that behavior could differ for CJK languages. You can find this in Options -> Language. Thanks for your cooperation.

The issues you have found earlier (filed as WORDSNET-19749) have been fixed in this Aspose.Words for .NET 20.2 update and this Aspose.Words for Java 20.2 update.