Free Support Forum -

StringBuilder.AppendLine Puts Left Indent to Next Line in Multiline Textbox - Convert DOCX to PDF using C# .NET


We have a problem with textbox shape. I found the code snippet provided here:

When saving to DOCX, everything is OK.
When saving to PDF, the first line is OK but the second and third have a “left indent” or something so text is not aligned.

I’ve attached a sample project so you can reproduce easily.

Is there a property or something I can set to avoid this behavior?

Thanks a lot and have a nice day!


Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 13.3.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The issue ID is WORDSNET-8080. Your request has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Moreover, you may use the following code as a temporary workaround to this problem:

strBuilder.Append("asdasdas" + ControlChar.LineBreak);

I hope, this helps.

Best regards,