iText Toolbox
Opening the Toolbox
The iText toolbox can be started in two different ways.
You can download the iText.jar. This is an executable jar.
You can execute it with:
All tools can also be called from the commandline with the same arguments in the same order as documented below. Or you can call the tools from your own Java applications (see the API for more info).
java -jar iText.jarOr you can install it as a Java Web Start (JWS) application, just by clicking this JNLP-file.
All tools can also be called from the commandline with the same arguments in the same order as documented below. Or you can call the tools from your own Java applications (see the API for more info).
Convert2Pdf
This set of tools allows you to produce PDF files from different sources:
- KnitTiff: Suppose you have scanned a book and the end result is two TIFF files.
One with the even pages, another one with the odd pages. KnitTif will knit these two TIFF files together
into one PDF that has all the pages in the right order.
- arguments
- odd: the TIFF file with the odd pages
- even: the TIFF file with the even pages
- destfile: the path to the PDF that should be generated
- PhotoAlbum: Build a PhotoAlbum in PDF, containing all the images from a certain directory.
The thumbnail pane of the PDF is opened, so that you can see thumbnails of all the images.
The thumbnails have the filename of the image as page label.
- arguments
- srcdir: the path to the directory that contains all the images
- destfile: the path to the PDF that should be generated
- Tiff2Pdf: Converts a (multipage) TIFF file to PDF.
- arguments
- srcfile: the original TIFF file
- destfile: the path to the PDF that should be generated
- pagesize: (optional) can be A4 (default), LETTER or ORIGINAL. When ORIGINAL is chosen, the pages have the same size as the pages of the TIFF.
- Txt2Pdf: Converts a plain ASCII txt file to PDF. The font that will
be used is Courier 11pt for documents in PORTRAIT, Courier 10pt for documents in LANDSCAPE.
- arguments
- srcfile: the original file
- destfile: the path to the PDF that should be generated
- pagesize: a very complete list of page sizes is presented.
- orientation: (optional) PORTRAIT (default) or LANDSCAPE
Encrypt
This set of tools allows you to encrypt/decrypt PDF files:
- Encrypt: encrypts a PDF
- arguments
- srcfile: the unencrypted PDF file you want to encrypt
- destfile: the path to the encrypted PDF that should be generated
- ownerpassword: (optional) password to be entered when you want to change the permissions or decrypt the PDF afterwards
- userpassword: (optional) password to be entered by the user if he wants to see the PDF
- permissions: (optional) check the permissions that should be present in the PDF file. If you are using this tool from the commandline, it's a String with a series of '0' and '1' values.
- strength: (optional) you can choose 40 bit or 128 bit encoding
Manipulate
This set of tools allows you to manipulate existing PDF files:
- Burst: Splits a PDF into single pages. One page per new PDF file, the files have the same name as the original file, but an underscore and page number are added.
- arguments
- srcfile: the path to the PDF that should be split into single pages.
- Concat: Concatenates 2 PDF files into 1.
- arguments
- srcfile1: the path to the first PDF
- srcfile2: the path to the second PDF
- destfile: the path to the PDF that should be generated
- SelectedPages: Allows you to copy a selection of pages from an existing PDF into a new PDF file.
- arguments
- srcfile: the path to the original PDF
- destfile: the path to the PDF that should be generated
- selection: a range of pages; the general syntax is:
[!][o][odd][e][even]start-end
You can have multiple ranges separated by commas ','.
The '!' modifier removes the range from what is already selected.
The range changes are incremental, that is, numbers are added or deleted as the range appears.
The start or the end, but not both, can be ommited.
- Split: Splits a PDF file into two separate PDF files.
- arguments
- srcfile: the original PDF file
- destfile1: the path to the first PDF that should be generated (pages 1 to pagenumber - 1)
- destfile1: the path to the second PDF that should be generated (the rest of the pages)
- pagenumber: the number of the page where you want to split.
- Watermarker: Adds a text watermark to an existing PDF.
- arguments
- srcfile: the original file
- watermark: the text that will be used as watermark
- fontsize: the font size of the text watermark
- destfile: the path to the PDF that should be generated
Properties
This set of tools allows you to inspect PDF files:
- HtmlBookmarks: makes an HTML file containing the bookmarks of your PDF.
For instance, if you have the file ChapterSection.pdf from the tutorial,
you can make a ChapterSection_index.html that holds contains the index for the
PDF and links to the specific pages. The same goes for OutlineActions.pdf and
OutlineActions_index.html (where the bookmarks can be links to a remote document or URL too).
- arguments
- srcfile: the PDF file you want to inspect
- ownerpassword: (optional) if the file is encrypted, you have to enter the ownerpassword
- InspectPDF: generates a list with properties of the PDF, such as number of pages, number of PDF objects, metadata,...
- arguments
- srcfile: the PDF file you want to inspect
- ownerpassword: (optional) if the file is encrypted, you have to enter the ownerpassword
Various
These are some handy tools that can be used for different purposes:
- DvdCover: Makes you a nice DVD cover for your home movies.
- arguments
- destfile: the path to the PDF that should be generated
- title: the title of the DVD
- backgroundcolor: the backgroundcolor of the DVD Cover (for instance 0xFFFFFF)
- front: (optional) the front image of the DVD Cover
- back: (optional) the back image of the DVD Cover
- side: (optional) the side image of the DVD Cover
- Handouts: Generates handouts with room for notes, based on an existing PDF file.
- arguments
- srcdir: the path to the directory that contains all the images
- destfile: the path to the PDF that should be generated
- pages: you can choose the number of original pages that should come on one page