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()
If you are looking for a solution to Itext7 then you can use the method setTextAlignment(...).
setTextAlignment(...)
Example:
Paragraph preface = new Paragraph(); // add text preface.setTextAlignment(TextAlignment.CENTER);