Kukoy Kukoy - 3 years ago 164
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.


Answer Source
PDFPTable.HorizontalAlignment = Element.ALIGN_CENTER;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download