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

Free Support Forum - aspose.com

Extra pages created in PDF converted from DOCX

Hi,

When converting a DOCX to PDF, I noticed an extra page was created and the bookmark reference page number got changed.

Code:
var doc = new Document(@".\test5.docx");
doc.Save(@".\test5.pdf");

I’ve attached my test files and a screenshot for your reference. Could you please take a look?

test5.zip (327.8 KB)
image.png (138.6 KB)

Thanks,

@ServerSide527,

While using the latest version of Aspose.Words i.e. 19.10, we managed to reproduce this issue on our end. We have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-19470. Your thread has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

@ServerSide527,

Regarding WORDSNET-19470, we have completed the work on your issue and concluded to close this issue as Not a Bug. Please see the following analysis details:

This Word document has the Kerning feature enabled. Aspose.Words can correctly render such documents only with the help of the HarfBuzz shaping engine. This requires installing the Aspose.Words.Shaping.Harfbuzz nuget package and adding an extra line of code:

var doc = new Document(@".\test5.docx");
doc.LayoutOptions.TextShaperFactory = Aspose.Words.Shaping.HarfBuzz.HarfBuzzTextShaperFactory.Instance;
doc.Save(@".\test5.pdf");

To learn more about OpenType features, please refer to the following article:
How to Use OpenType Features