Text is Moved to Previous Line after DOCX to PDF conversion using .NET

Hi,

When converting a DOCX to PDF with Aspose, I noticed some text was moved to the previous line.

Code:

var doc = new Document(@".\test.docx");
doc.LayoutOptions.TextShaperFactory = HarfBuzzTextShaperFactory.Instance;
doc.Save(@".\test.pdf");

It seems to only happen when there’s a word ending with dash + space ("- ") at the beginning of a line, Aspose decided to move it to the end of the previous line when rendering PDF. If I replaced the dash ‘-’ with any other character of the same width, the issue didn’t happen (see my test2 example attached).

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

test.zip (245.5 KB)
image.png (82.7 KB)

Thanks,

@ServerSide527

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-21929. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.

We have not found any issue for document (test2DashReplaced.docx) at our end. Could you please share some detail if you are facing any issue for this document?

@tahir.manzoor thanks for looking into this.

Please refer to my initial comment - test2DashReplaced does not have any issues, it is an example where after replacing the ‘-’ with any other characters, the issue no longer happened compared to the problematic test 1 ecxample.

Thanks,

@ServerSide527

Thanks for sharing the detail. We will inform you once there is an update available on your issue.

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