Itext pdf signature example1/8/2024 ![]() The example contains the usage of Fonts, chapters, and sections. Let’s see some examples of styling the content of PDF. tListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 6))) List sublist = new List(true, false, 30) List nestedList = new List(List.UNORDERED) ZapfDingbatsList.add(new ListItem("Item 3")) ZapfDingbatsList.add(new ListItem("Item 2")) ZapfDingbatsList.add(new ListItem("Item 1")) ZapfDingbatsList zapfDingbatsList = new ZapfDingbatsList(43, 30) ![]() UnorderedList.add(new ListItem("Item 3")) UnorderedList.add(new ListItem("Item 2")) UnorderedList.add(new ListItem("Item 1")) List unorderedList = new List(List.UNORDERED) List orderedList = new List(List.ORDERED) PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("ListExample.pdf")) ĭocument.add(new Paragraph("List Example")) Creating List of Items in PDFīelow example will help you understand how to write lists in pdf files using the iText library. To avoid having the cell border and the content overlap, if you are having thick cell bordersĪddTableExample Pdf Output 7. PdfPCell cell3 = new PdfPCell(new Paragraph("Cell 3")) ĬtHorizontalAlignment(Element.ALIGN_CENTER) ĬtVerticalAlignment(Element.ALIGN_MIDDLE) PdfPCell cell2 = new PdfPCell(new Paragraph("Cell 2")) ĬtHorizontalAlignment(Element.ALIGN_CENTER) ĬtVerticalAlignment(Element.ALIGN_MIDDLE) PdfPCell cell1 = new PdfPCell(new Paragraph("Cell 1")) ĬtHorizontalAlignment(Element.ALIGN_CENTER) ĬtVerticalAlignment(Element.ALIGN_MIDDLE) PdfPTable table = new PdfPTable(3) // 3 columns. PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("AddTableExample.pdf")) Generating a Table in PDFīelow example shows how to add tables in a pdf document. PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("HelloWorld.pdf")) ĭocument.add(new Paragraph("A Hello World PDF document.")) ĪddImageExample Pdf Output 6. ![]() I will create a PDF file with a single statement in the content. Let’s start writing our example codes with the typical Hello World application.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |