Introduction:
This page was copied from iText tutorial page and modified for iText.NET. Visit http://www.lowagie.com/iText/ to see an original document. Here are some missing links, which will be made in future.
iText is a library that allows developers to extend the capabilities of their web server (and other JAVA) applications with dynamic PDF document generation. In this tutorial, you will find lots of standalone examples to learn how to use most of the iText functionality and features. It should be easy to integrate most of the solutions in a Servlet, a Java Web Start application or some other Java program. This tutorial is far from complete, but it will be updated on a regular basis.
-
Part I: General Use of iText
-
Part II: Using High Level Objects
-
Part III: Fonts
-
Part IV: Direct Content
-
Part V: Interactive Features (AcroForms)
-
Part VI: the iText Toolbox explained
-
Part VII: RTF
-
Part VIII: HTML
-
Part IX: XML
-
Part X: Under the hood
Part I: General Use of iText
| Hello World How-to generate a PDF document with iText in 5 easy steps. | |
|
Sections
|
Examples
DefaultPageSize
Generates a PDF document with the default page size and some
other predefined standard pagesizes
Output:
LandscapePortrait
Generates a PDF document with the first page in Lanscape;
the second page in Portrait
Output:
HelloWorldMultiple
Writing to different writers at the same time; using pause()
and resume()
Output:
HelloEncrypted
Again a PDF with the text 'Hello World', but this time the
document is encrypted. To read it, you need to know the
userpassword: 'Hello'
Output:
|
| Manipulating existing PDF documents How-to copy/manipulate existing PDF documents. | |
|
Sections
|
Examples
Concatenate
Concatenates existing PDF files
Argument(s):
Input:
Output:
|
| Frequently Asked Questions This is a basic technical reference that answers some frequently asked questions. | |
|
Sections
|
Examples
|
Part II: Using High Level Objects
| Basic Text Objects Some basic text objects that are used in iText. | |
|
Sections
|
Examples
SymbolSubstitution
Demonstrates how special characters are substituted by
Symbols with Phrase.getInstance
Output:
FontSelection
Selects the appropriate fonts that contain the glyphs needed
to render text correctly
Output:
|
| The Chunk Object Describes the functionality of the Chunk object. | |
|
Sections
|
Examples
|
| Anchors, Actions and Annotations Deals with all the RemoteGoto, LocalGoto, Action, Annotation,... functionality | |
|
Sections
|
Examples
OpenApplication
Creates a document with a link to open an external
application.
Argument(s):
Output:
|
| Viewerpreferences, Pagelabels, Optional Content and Bookmarks Deals with all the PDF Viewerpreferences, Bookmarks, Outlines, Destinations,... functionality | |
|
Sections
|
Examples
ViewerPreferences
Creates three versions of the same document, but with
different viewerpreferences
Output:
OutlineActions
Creates a document with external destinations or actions
that can be called from Bookmarks
Output:
|
| Images Deals with all types of images that are supported by iText | |
|
Sections
|
Examples
ImageSequence
Adds images to a document, once respecting the order in
which they were added, once in the default order.
Input:
Output:
DvdCover
Make a DVD Cover.
Argument(s):
Input:
Output:
|
| Selected examples: EPS, TIFF, Barcodes Selected examples: Embedding PostScript, importing TIFF files, Barcodes | |
|
Sections
|
Examples
Tiff2Pdf
Converts some tiff files to PDF
Argument(s):
Input:
Output:
OddEven
Combines 2 tiffs, one with odd, another with even pages into
1 combined PDF
Argument(s):
Input:
Output:
|
| Tables How to organize text and data in tables with iText | |
|
Sections
|
Examples
SplitRows
Add a table to a PDF with document.add() and if the cell
doesn't fit, the row is split in two parts
Output:
|
| PdfPTable Some extra PdfPTable functionality | |
|
Sections
|
Examples
FragmentTable
Break one large Table up into different smaller tables with
the same header
Argument(s):
Output:
|
| Alternatives for PdfPTable Some alternative ways to create a Table | |
|
Sections
|
Examples
|
| ColumnText How to organize text and data in columns with iText | |
|
Sections
|
Examples
|
Part III: Fonts
| The Font objects Describes the different Font objects in iText. | |
|
Sections
|
Examples
|
| Font characteristics Changing the style of a Font. | |
|
Sections
|
Examples
|
| Getting fonts Overview of the different types of fonts supported by iText. | |
|
Sections
|
Examples
UsingFontFactory
Sums up the Fonts that are available in some standard font
directories on your system
Output:
OpenTypeFont
Using an Open Type Font with Compact Font Format (CFF) data
only (no true type outlines)
Input:
Output:
|
Part IV: Direct Content
| Direct Content Add content directly to the PDF file using the PdfContentByte class. | |
|
Sections
|
Examples
|
| Coordinate Systems Coordinate Systems - changing the Current Transformation Matrix (CTM) | |
|
Sections
|
Examples
XandYcoordinates
Puts some marks at specific X and Y coordinates; connects
the marks with a line and puts some text next to the marks
Output:
|
| Graphics State Add graphics directly to the PDF file using the PdfContentByte class. | |
|
Sections
|
Examples
|
| Colors Colors, Transparency, Spotcolors, Patterns and Shading. | |
|
Sections
|
Examples
|
| Text Add text content directly to the PDF file using the PdfContentByte class. | |
|
Sections
|
Examples
|
| Page Events Add content directly to the PDF file using the PdfContentByte class. | |
|
Sections
|
Examples
PageNumbersWatermark
Making a document with a header containing 'page x of y' and
with a watermark on every page.
Input:
Output:
|
| Optional Content Add optional content to a PDF file. | |
|
Sections
|
Examples
|
Part V: Interactive Features (AcroForms)
| Interactive FormsStep for step creation of an Acroform. | |
|
Sections
|
Examples
ListFields
Reads different pdf fields and lists the acrofields
Argument(s):
Output:
ANT script (all examples):
|
| Creating FormsStep for step creation of an Acroform. | |
|
Sections
|
Examples
ANT script (all examples):
|
| Working with existing PDF documentsHow-to copy/manipulate existing PDF documents. | |
|
Sections
|
Examples
ANT script (all examples):
|
Part VI: the iText Toolbox explained
Under Construction
Go to top of the page
Part VII: RTF
| Rich Text Format How-to generate RTF documents using iText. | |
|
Sections
|
Examples
|
Part VIII: HTML
| Generating HTML with iText How-to generate a HTML documents with iText | |
|
Sections
|
Examples
|
Part IX: XML
Under Construction
Go to top of the page
Part X: Under the hood
Under Construction
Go to top of the page