We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Apply Widow/Orphan Rule to Paragraphs inside Table Cells in Compatibility Mode to Retains Vertical Spacing- DOC to PDF

When you want to display the attached Word document as a pdf in the application, it adds a space to the page. On different servers, it adds space to a different page.
I attached the original file, corrupted file, and screenshot.
YG5124.zip (503.5 KB)


We tested the scenario and have managed to reproduce the same problems on our end. For the sake of corrections, we have logged the following issues in our issue tracking system.

WORDSNET-19637: A line moves to the next page in PDF
WORDSNET-19638: Big vertical space added between paragraphs in PDF
WORDSNET-19639: Vertical spacing between Tables not preserved in PDF
WORDSNET-19640: Extra vertical spacing added at the top of Page in PDF

We will further look into the details of these issues and will keep you updated on the status of corrections. We apologize for your inconvenience.


Regarding WORDSNET-19637, it is to update you that we have completed the analysis of this issue and the root cause has been identified. The problem occurs because the widow\orphan rule currently does not apply to paragraphs inside table cells in compatibility mode. This is supported by Aspose.Words, but widow\orphan rule should not be applied to the cell part, it should be applied to the whole column. So, we will improve the current logic of Aspose.Words.

In the meantime, while you are waiting for a fix, you may turn off the widow\orphan rule for the problematic paragraph as a workaround.

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

The error persists. The test project is attached.


Thanks for your inquiry. We are checking this scenario and will get back to you soon.


Regarding WORDSNET-19637, please note that the output is affected by “use printer metrics” option. There is a known issue that new MS Word versions (e.g. 2019) ignore the option and Aspose.Words does not.

The UsePrinterMetrics option is enabled in the source Word document. MS Word 2019 does not take this option into account, and its behavior is similar to the situation when this option is disabled. But Aspose.Words supports this option if it is enabled.

So, to get the desired output, it is necessary to disable this option.

Document doc = new Document("E:\\YG5124\\KGV-PL-42.doc");
doc.CompatibilityOptions.UsePrinterMetrics = false;

Hope, this helps.

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