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

Free Support Forum - aspose.com

HorizontalAlignment.Justify bug

Hello.


I need to add a text paragraph with left and right margins. Text should be justified. Here it is my code:

Document document = new Document();
Page docPage = document.Pages.Add();
docPage.PageInfo = new PageInfo
{
Margin = new MarginInfo { Bottom = 0, Left = 0, Right = 0, Top = 0 }
};

TextFragment tf = new TextFragment("This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. This is the sample text. ");

tf.HorizontalAlignment = HorizontalAlignment.Justify;
tf.Margin = new MarginInfo(30, 0, 30, 0);
docPage.Paragraphs.Add(tf);

The result is attached. The right margin is ignored. Also the text looks ugly and does not fit the page. What did I wrong? Please advise.


Hi Dmitry,


Thanks for your inquiry. We have noticed the reported issue and logged a ticket PDFNEWNET-39005 in our issue tracking system for further investigation and resolution. We will notify you as soon as it is resolved.

We are sorry for the inconvenience caused.

Best Regards,

The issues you have found earlier (filed as PDFNET-39005) have been fixed in Aspose.PDF for .NET 19.12.