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 any one is looking for .NET/C# version, below is how I achieved the CENTER alignment.
I am using iText7 library for .NET/C#, and I achieved this using :
Paragraph preface = new Paragraph(); preface.SetTextAlignment(iText.Layout.Properties.TextAlignment.CENTER);