Align Paragraph at the center of the page

后端 未结 7 1358
执笔经年
执笔经年 2021-01-03 21:03

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()         


        
7条回答
  •  情话喂你
    2021-01-03 21:35

    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);
    

提交回复
热议问题