Kukoy Kukoy - 1 month ago 6
C# Question

iTextSharp center align objects within the Document object

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!

Answer
PDFPTable.HorizontalAlignment = Element.ALIGN_CENTER;
Comments