ITEXT PDF / CATATAN</>↗iText PDF24 Jan 2024
Creating an ordered list in iText 8 involves creating a List object and adding ListItem objects to it, similarly to creating an unordered list. For automatic numbering or bullets in a list, you’ll have to use ListNumberingType with the appropriate configuration. For example, ListNumberingType.DECIMAL for Arabic number (1, 2, 3, etc.) and ListNumberingType.ENGLISH_LOWER for English […]
ITEXT PDF / CATATAN</>↗iText PDF24 Jan 2024
Creating an unordered list in iText 8 involves creating a List object and adding ListItem objects to it. Here is an example of how you can do this: package org.kodejava.itext; import com.itextpdf.layout.Document; import com.itextpdf.layout.element.List; import com.itextpdf.layout.element.ListItem; import com.itextpdf.kernel.pdf.PdfDocument; import com.itextpdf.kernel.pdf.PdfWriter; public class UnorderedListExample { public static void main(String[] args) throws Exception { P...
ITEXT PDF / CATATAN</>↗iText PDF24 Jan 2024
In iText 8, indentation of a Paragraph can be controlled using the setMarginLeft() and setMarginRight() method of the BlockElement class which is the super class of Paragraph. Here is an example of how to indent a paragraph: package org.kodejava.itext; import com.itextpdf.kernel.pdf.PdfDocument; import com.itextpdf.kernel.pdf.PdfWriter; import com.itextpdf.layout.Document; import com.itextpdf.layout.element.Paragraph; public class ParagraphIndentation { public static void mai...
ITEXT PDF / CATATAN</>↗iText PDF23 Jan 2024
Displaying emojis using iText 8 requires you to use a font that supports the unicode characters for emojis. By default, the most common fonts don’t support colorful emojis, but you can use some fonts like Segoe UI Emoji (which comes with Windows 10), Apple Color Emoji, NotoColorEmoji or FreeSerif to display black and white outlined […]
ITEXT PDF / CATATAN</>↗iText PDF23 Jan 2024
In iText 8, if you want to style only part of the text inside a Paragraph object, you can use the Text object to encapsulate the text that needs separate styling. Here’s an example: package org.kodejava.itext; import com.itextpdf.kernel.pdf.PdfDocument; import com.itextpdf.kernel.pdf.PdfWriter; import com.itextpdf.kernel.font.PdfFont; import com.itextpdf.kernel.font.PdfFontFactory; import com.itextpdf.kernel.colors.DeviceRgb; import com.itextpdf.layout.Document; import com.it...
ITEXT PDF / CATATAN</>↗iText PDF23 Jan 2024
The Paragraph class in iText 8 is a fundamental building block in the creation of a PDF document. It is used to add and format texts in your document. Here’s a simple code snippet that demonstrates how to use Paragraph: package org.kodejava.itext; import com.itextpdf.kernel.pdf.PdfDocument; import com.itextpdf.kernel.pdf.PdfWriter; import com.itextpdf.layout.Document; import com.itextpdf.layout.element.Paragraph; public class ParagraphExample { public […]