jPDFWriter Source Code Samples

Following are a number of Java samples that use jPDFWriter and some of its features:

HelloWorld.java – Creates a simple PDF document with the text “Hello World” on it.

CreatePDFWithTextAndImage.java – Creates a PDF document with a page and draw an image (loaded from a file) and text on it.

TextToPDF.java  – Reads a text file and coverts it to a PDF document. This sample takes care of wrapping and pagination.

TextPrinter.java – Reads a text file and converts it to a PDF document. This sample uses the PDFPrinterJob object to “print” the text to the PDF file.

DataTablePrinter.java – Creates a PDF document from a data table. The program draws the data to the document in a table form, with an optional grid.

ServletSample.java – An example that uses jPDFWriter from within a servlet. The samples creates a PDF document runtime and serves the document directly to the client browser, without using any temporary files on the server.