Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iTextSharp center align objects within the Document object

Tags:

Is there a quick and simple way to center align objects within the Document object? Without performing any calculation logic, ie. Get width of page, get width of contents, divide by two, etc.

I have a PdfPTable object within a Paragraph object, within the Document object. I would like to center the Paragraph object.

Thanks!

like image 894
Since_2008 Avatar asked Oct 01 '10 13:10

Since_2008


1 Answers

the equivalent replacement for iTextSharp :

paragraph.Alignment = Element.ALIGN_CENTER;

or try this way

paragraph.IndentationRight = 100;
paragraph.IndentationLeft = 100;
like image 108
JwL Avatar answered Oct 15 '22 01:10

JwL