Open playersun opened 2 months ago
You can use a PdfPTable to store two PdfPCells in the same row. One PDF can be set to left aligned, where the other string is set to center aligned. However, PdfPTable assigns a certain percentage of the width to each of its cells, meaning that the center aligned string will only be within the center of the assigned width. You can manually set the widths using a lot of math such that the second column, if left aligned, will appear to be globally centered in the page.
Alternatively, you can use the ColumnText class and set up two columns of text, with one left aligned and one middle aligned. The downside to this solution is that the columns have to be manually positioned.
You can use a PdfPTable to store two PdfPCells in the same row. One PDF can be set to left aligned, where the other string is set to center aligned. However, PdfPTable assigns a certain percentage of the width to each of its cells, meaning that the center aligned string will only be within the center of the assigned width. You can manually set the widths using a lot of math such that the second column, if left aligned, will appear to be globally centered in the page.
Alternatively, you can use the ColumnText class and set up two columns of text, with one left aligned and one middle aligned. The downside to this solution is that the columns have to be manually positioned.
OK, Got it. Thanks a lot!