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()
Use Paragraph#setAlignment(int) :
Paragraph preface = new Paragraph(); preface.setAlignment(Element.ALIGN_CENTER);
See the ALIGN_* constants in the Element interface for more possible values.
ALIGN_*