Step-by-step installation of iText on Windows

This tutorial will help you installing iText on Windows. iText allows you to create PDF files from Java. A new and better tutorial on how to run iText with Eclipse is now available.

First, you need to install Java, which is an excellent object oriented programming language.

  1. Download the latests Java SE JDK version from the web site http://java.sun.com/.
  2. Follow the installer software instructions and install the Java
  3. TextPad (http://www.textpad.com/) is an excellent free Java editor you might want to use to create Java programs.

Next, you need to install iText.To create PDF files from a Java-editor, an extra package containing the necessary classes is made available: iText.jar. In order for the system software and thus all the Java-editors to recognize this extra package a few simple steps have to be taken to set a proper classpath. They are described and visualized below.

  1. Go to the web site http://www.lowagie.com/iText/.
  2. Go to ‘Downloads’ and save the file iText.jar to your hard disk.
  3. Place the file iText.jar in a folder that is easy to recall. Example: D:\java\iText\iText.jar
  4. Right-click ‘My Computer’ and select ‘Properties’ [Picture 1]
    System properties
  5. Select tab page ‘Advanced’ [picture 2]
    System properties
  6. Click the button ‘Environmental variables‘ [picture 3]
    Advanced tab
  7. Within ‘System variables‘ a new variable “CLASSPATH” (all capitals) has to be created if it isn’t there yet. [picture 4]
    Environment variables
  8. The value of the variable “CLASSPATH” must contain the location of the iText.jar file. Example: “.;D:\java\text\iText.jar;” [picture 5]
    System variable
  9. Select ‘OK’ three times to close down all the open windows.
  10. Open a Java-editor, such as TextPad, and load a tutorial Java-file (also available at the iText web site). Compile and run the Java source code to test if the installation is successful.

You should now be able to create PDF files from Java.

6 thoughts on “Step-by-step installation of iText on Windows”

  1. I did these steps, but when I ran my program this error was showed:
    … java.lang.ClassNotFoundException: com.lowagie.text.Document

    Can you help ?

  2. Thanks Christoph, for your valuable steps to do correct setup, and this is very good approach to teach others, How to use iText.

Leave a Reply

Your email address will not be published. Required fields are marked *