Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
- Document doc = new Document(iTextSharp.text.PageSize.A4,50,50,120,40);
- PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(path+"\Invoices\Test.pdf", FileMode.Create));
- PdfPTable table = new PdfPTable(2);
- table.WidthPercentage = 100;
- table.DefaultCell.BorderWidth = 0;
- table.DefaultCell.HasBorder(iTextSharp.text.Rectangle.NO_BORDER);
- table.AddCell(new PdfPCell() { HorizontalAlignment = PdfPCell.ALIGN_LEFT, Phrase = new Phrase("Text to the left"), BorderColor = BaseColor.WHITE, BorderWidth = 0 });
- table.AddCell(new PdfPCell() { HorizontalAlignment = PdfPCell.ALIGN_RIGHT, Phrase = new Phrase("Text to the right"), BorderColor = BaseColor.WHITE, BorderWidth = 0 });
- // table.AddCell(new PdfPCell("Text to the left", PdfPCell.ALIGN_LEFT));
- // table.AddCell(new PdfPCell("Text to the left", PdfPCell.ALIGN_RIGHT));
- document.add(table);
- doc.Open();
- Paragraph p = new Paragraph("This is a first text above n n", FontFactory.GetFont("Arial", 8.0f, BaseColor.BLACK));
- doc.Add(p);
- doc.Add(table);
- doc.Close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement