ITEXT PDF / NOTES</>↗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 / NOTES</>↗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 / NOTES</>↗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 / NOTES</>↗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 […]
ITEXT PDF / NOTES</>↗iText PDF23 Jan 2024
In iText 8, you can use the AreaBreak class to add a new page to a Document. An AreaBreak is used to start a new area in the document. This can be compared to a page break in word processing software, but in iText, it’s a bit more flexible. You can use AreaBreak to create […]
ITEXT PDF / NOTES</>↗iText PDF23 Jan 2024
iText is a highly versatile and robust library used for creating and manipulating PDF files in Java. It is capable of generating high-quality documents with complex layouts and rich multimedia content. The ease of embedding text, images, tables, and interactive forms in PDFs make it a go-to library for developers dealing with document-intensive applications. It […]