Welcome > Generator > Getting Started > Examples > Java source code

The directory "DynamicPDF_~/ceTeSoftware/examples/Generator/" contains examples for DynamicPDF™ Generator for Java.

Open the "DynamicPDF_~/ceTeSoftware/examples/Generator" directory, run the command javac *.java to compile all the examples, and then test the HelloWorld example by running the command java HelloWorld. A file named HelloWorld.pdf should be present in the "DynamicPDF_~/ceTeSoftware/examples/Generator" folder which will indicate that the product has been successfully installed. Similarly you can run other java files to see their respective output. Brief descriptions of the examples are given below:

*HelloWorld.java
This example shows how to generate a simple PDF document.

*HelloWorld40BitEncrypted.java
This example shows how to generate a PDF document with 40 bit encryption. User password is "user" and owner password is "owner".

*HelloWorld128BitEncrypted.java
This example shows how to generate a PDF document with 128 bit encryption. User password is "user" and owner password is "owner". This example requires Acrobat 5.0 or compatible PDF viewer.

*HelloWorldLanguages.java
This example displays the International font capabilities. This example requires the Acrobat Asian Font Pack. If the output looks corrupted or you get the "File not found" exception then please check that the "unicodeFont" variable is pointing to correct font and the font you provided has Asian language support.

*AllPageElements.java
This example shows how to use all of the page elements that are available with Generator for Java. It also demonstrates how to build a custom page element.

*TimeMachine.java
This example shows how to generate a manuscript. This is a good example of how to use the overflow text methods to flow text to multiple pages.

*SourceView .java
This example reads and displays the source code of an java page, with color coding.

*TiffToPDF.java
This example shows how to generate PDF file from Tiff Image. This is a good example of how multipage tiff image can be converted into PDF file.

*USEnvelope.java
This example shows how to address an envelope and use the Postnet bar code.

*FormattedTextContinuation.java
This example shows how to use the text overflow functionality.

*SimpleXMLReport.java
This example shows how to generate a simple report from XML data.

*TableCalendar.java
This example shoes how to generate and use tables.

The following examples need to be configured to connect with Microsoft SQL Server "Northwind" database. Modify the value of the connection setting in respective java file's constructor found in the "examples" directory:


*SimpleReport.java ( Need MS SQL Server )
This example shows how to generate a simple report.

*ContactList.java
( Need MS SQL Server )
This example shows how to generate a report with grouping.

*Invoice.java
( Need MS SQL Server )
This example shows how to generate invoices with bar codes.

*TableReport.java ( Need MS SQL Server )
This example shows how to generate a report using the Table page element.

*MailingLabels.java ( Need MS SQL Server )
This example shows how to create mailing labels from database data. It is coded for Avery label number 5160 but the variables can easily be changed to accomodate many other label formats.