Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to align a paragraph (justify) whith Itext?

I have 2 lines and I want to align (justify) them.

I have this code:

    Paragraph p=new Paragraph(ANC,fontFootData);
    p.setLeading(1, 1);
    p.setAlignment(Element.ALIGN_JUSTIFIED);
    document.add(p);


    Paragraph p2=new Paragraph(RUTTEL,fontFootData);
    p2.setLeading(1, 1);
    p2.setAlignment(Element.ALIGN_JUSTIFIED);
    document.add(p2);

where ANC and RUTTEL are string, but they not be align.

Could anybody help me?

like image 682
danivare Avatar asked Jun 26 '13 18:06

danivare


1 Answers

For a one line use ALIGN_JUSTIFIED_ALL, more than one line use ALIGN_JUSTIFIED.

like image 156
Osman Yilmaz Avatar answered Oct 02 '22 15:10

Osman Yilmaz