I am using itext to generate pdf file. I want to align my title in the middle of the page. Presently i am using like this
Paragraph preface = new Paragraph()
This is what worked for me (itext 5.0.5 ):
Paragraph p3= new Paragraph("Hello" ); p3.setAlignment(Element.ALIGN_CENTER);