FullJustify issue

Hi support,

Please note the effects of the following code regarding the output.

Pdf pdf = new Pdf();
Section sec1 = pdf.getSections().add();
Text txt1 = new Text(sec1, "FullJustified Text");
Text txt2 = new Text(sec1, "Justified Text");
Text txt3 = new Text(sec1, "Text with background color");
txt1.getTextInfo().setAlignmentType(AlignmentType.FullJustify);
txt2.getTextInfo().setAlignmentType(AlignmentType.Justify);
txt3.getTextInfo().setBackGroundColor(Color.Red);
sec1.getParagraphs().add(txt1);
sec1.getParagraphs().add(txt3);
sec1.getParagraphs().add(txt2);
pdf.save(new FileOutputStream(new File("C:/Temp/TRS/pdf/FullJustifyBug.pdf")));

- the background color is not set correctly
- the "Justified Text" seems FullJustified; is this the expected behavior ? As far as I can see, FullJustified is the "distributed" equivalent from Word, and justify text shouldn't have the same appearance as the distributed text.

Best regards,
Milan

Hello Milan,

Let me share some things regarding Justify and FullJustify.

Justify alignment. Text will be aligned on both left and right margins, and the very last line will only be left-aligned.

FullJustify alignment. Text will be aligned on both left and right margins, and all lines will be left- and right-ligned.

See the PDF file in the attachment.

Regarding the background color issue, I have noticed that it’s working properly if the text element is added after Justify-aligned text or as the first element in the paragraphs collection of the PDF file. The issue occurs when the text element is added after FullJustify-aligned text. I have contacted the development team, and soon they will be updating you with the status of the correction.

We apologize for your inconvenience.

Hi milan,

I have logged this issue (PDFJAVA-6251) in our bug tracking system. I will give you a notice as soon as we have resolved this problem.

Thank you for your patience.

The issues you have found earlier (filed as 6251) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.