ITEXT PDF / NOTES</>↗iText PDF24 Dec 2011
The following example show you how to set the cell’s border width and color attributes. We can set the width and color at once using the setBorderWidth() and setBorderColor(). Or you can set it individually for each side of the cell’s border. You can also set the background color of a cell using the setBackgroundColor() […]
ITEXT PDF / NOTES</>↗iText PDF24 Dec 2011
You can set the rotation of the cell contents using the com.itextpdf.text.pdf.PdfPCell‘s setRotation() method. The valid rotation options are 0, 90, 180 and 270. package org.kodejava.itextpdf; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Phrase; import com.itextpdf.text.pdf.PdfPCell; import com.itextpdf.text.pdf.PdfPTable; import com.itextpdf.text.pdf.PdfWriter; import java.io.FileNotFoundException; import java.io.Fil...
ITEXT PDF / NOTES</>↗iText PDF23 Dec 2011
We can set table cell’s content alignment horizontally and vertically. To set the horizontal alignment we use the setHorizontalAlignment() method. To align it vertically we use the setVerticalAlignment() method. The alignment constant is defined in the com.itextpdf.text.Element class. package org.kodejava.itextpdf; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Element; import com.itextpdf.text.Phrase; import com.itextp...
ITEXT PDF / NOTES</>↗iText PDF23 Dec 2011
You can set the cell’s padding using the com.itextpdf.text.pdf.PdfPCell‘s setPadding() method. To set the padding individually you can use the setPaddingTop(), setPaddingRight(), setPaddingBottom(), and setPaddingLeft() methods to set the top, right, bottom and left padding respectively. package org.kodejava.itextpdf; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Phrase; import com.itextpdf.text.pdf.PdfPCell; import co...
ITEXT PDF / NOTES</>↗iText PDF22 Dec 2011
To create a cell in a table that span into multiple columns you can use the setColspan() method in the com.itextpdf.text.pdf.PdfPCell object. The example below show you how to do it. package org.kodejava.itextpdf; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Phrase; import com.itextpdf.text.pdf.PdfPCell; import com.itextpdf.text.pdf.PdfPTable; import com.itextpdf.text.pdf.PdfWriter; import java.io.FileNotFoundExceptio...
ITEXT PDF / NOTES</>↗iText PDF20 Dec 2011
This example show you how to use the com.itextpdf.text.ZapfDingbatsList class to create a ZapfDingbatsList list using the iText pdf library. package org.kodejava.itextpdf; import com.itextpdf.text.*; import com.itextpdf.text.pdf.PdfWriter; import java.io.FileNotFoundException; import java.io.FileOutputStream; public class ZapfDingbatsListDemo { public static void main(String[] args) { Document doc = new Document(); try { PdfWriter.getInstance(doc, new FileOutputStream("ZapfDi...