Rotate pdf table
Set location for table
PdfPTable pdfTable = new PdfPTable(9);
BaseFont bfCalibri = BaseFont.CreateFont("c:\\windows\\fonts\\calibri.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
iTextSharp.text.Font calibri = new iTextSharp.text.Font(bfCalibri, 8);
iTextSharp.text.Font calibri2 = new iTextSharp.text.Font(bfCalibri, 9);
PdfPCell cell = new PdfPCell(new Phrase("EVIDENICIJA UTROŠKA GORIVA I MAZIVA"));
cell.Colspan = 9;
cell.HorizontalAlignment = 1;
pdfTable.AddCell(cell);
cell.VerticalAlignment = 1;
cell.HorizontalAlignment = 1;
cell.VerticalAlignment = 1;
Amit MohantyPosted May 17, 2023, 12:24 PM
To rotate a PDF table and set its location using iTextSharp, you can use the
Rotate()method and theSetTotalWidth()andWriteSelectedRows()methods.Konga MounikaPosted May 17, 2023, 11:24 AM
Hi sir,
To rotate a PDF table, you can use the following steps:
The table will be rotated by the specified angle.
To set the location of a table in a PDF file, you can use the following steps:
The table will be moved to the specified location.
In your specific example, you can rotate the table by 90 degrees clockwise by following these steps:
The table will be rotated by 90 degrees clockwise.
To set the location of the table, you can drag it to the desired location on the page.
Here is the complete code to rotate a PDF table and set its location:
PdfPTable pdfTable = new PdfPTable(9); BaseFont bfCalibri = BaseFont.CreateFont("c:\windows\fonts\calibri.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); iTextSharp.text.Font calibri = new iTextSharp.text.Font(bfCalibri, 8); iTextSharp.text.Font calibri2 = new iTextSharp.text.Font(bfCalibri, 9); PdfPCell cell = new PdfPCell(new Phrase("EVIDENICIJA UTROŠKA GORIVA I MAZIVA")); cell.Colspan = 9; cell.HorizontalAlignment = 1;
pdfTable.AddCell(cell); cell.VerticalAlignment = 1; cell.HorizontalAlignment = 1; cell.VerticalAlignment = 1;
// Rotate the table by 90 degrees clockwise pdfTable.Rotate();
// Set the location of the table pdfTable.SetLocation(100, 100);
// Add the table to the document document.Add(pdfTable);
thumb_upthumb_down