PDF file creation: iText
iText is a free Java class library to create PDF files.
Features:
Below is a simple bar code example taken from the documentation:
ThereĀ“s also an iText ant task (from the Fopps project) which takes an XML file as input and generates a PDF file (HTML and RTF are also supported).
Below is an example, which builds a pdf document out of plain.xml. Every page contains the header 'My header' and the footer 'Page x of y':
Features:
- Barcode generation with or without fonts (Code 39, Code 128, EAN13, EAN8, UPCA, UPCE, and EAN with supplemental 5, EAN with supplemental 5, EAN with supplemental 2, Interleaved 2 of 5, Postnet and Planet)
- PDF encryption
- Headers and footers
- Absolute positioning of graphics (PNG, GIF, JPEG, WMF) and text
- Table support (see also the more advanced PDFTable class)
- Metadata manipulation
- HTML output
- RTF output
- Local and remote goto, destinations and outlines
- Includes tools to concat, split, create a handout and encrypt PDF files
- etc...
Below is a simple bar code example taken from the documentation:
PdfContentByte cb = writer.getDirectContent();
BarcodeEAN codeEAN = new BarcodeEAN();
codeEAN.setCodeType(codeEAN.EAN13);
codeEAN.setCode("9780201615883");
Image imageEAN = codeEAN.createImageWithBarcode(cb, null, null);
document.add(new Phrase(new Chunk(imageEAN, 0, 0)));
ThereĀ“s also an iText ant task (from the Fopps project) which takes an XML file as input and generates a PDF file (HTML and RTF are also supported).
Below is an example, which builds a pdf document out of plain.xml. Every page contains the header 'My header' and the footer 'Page x of y':
<itext
src="Plain.xml"
dest="Test1.pdf"
header="My header"
footer="pagenumbering">
</itext>
0 Comments:
Post a Comment
<< Home