Package com.coherentpdf

package com.coherentpdf

Jcpdf is a Java interface to the cpdf pdf tools. More information, including commercial licenses can be found at

The sofware is free for non-commercial use. The non-commercial home of this software is

Obtaining and installing the DLLs

The DLLs "cpdf" and "jcpdf" are required. The "cpdf" DLL is free for non-commercial use. Commercial use requires a license. The DLLs can be obtained here for all platforms here:

Before using the library, you must make sure your project or build environment has access to the jcpdf and cpdf DLLs, which are not part of the Java .jar.

The java library invokes LoadLibrary on the jcpdf DLL, and so it must be placed in your java.library.path. The cpdf DLL itself will be searched for not by Java, but by your system, as a dependency of jcpdf.

Windows Files should be named jcpdf.dll and libcpdf.dll. Put jcpdf.dll in your java.library.path and then libcpdf.dll in the same folder, or in a standard location such as System32.

Linux Files should be named and Put in your java.library.path. You must put in a standard location such as /usr/local/lib, or set LD_LIBRARY_PATH. Simply putting it in the same folder as will not work.

MacOS Files should be named libjcpdf.dylib and Put libjcpdf.dylib in java.library.path. You can put in the same folder - it will be picked up automatically.


Full manual (required reading):

Follow the instructions at the end of Chapter 1 to write your first program.

In addition, the Jcpdf package provides documentation with each function, which you can view in your IDE.


Create an instance of the library with, for example Jcpdf.jcpdf = new Jcpdf(). You must call startup() to initialise the library prior to calling any other function.

PDFs are of type Jcpdf.Pdf. Page ranges are of type Jcpdf.Range. Both PDFs and ranges are not automatically garbage-collected. Use try or the close() method to dispose of them.

Exceptions are of type Jcpdf.CpdfError and may be raised by any function.


Bug reports:

  • Class
    The Coherent PDF Library for Java
    Any function in this library may raise the CpdfError exception, which carries a string describing the nature of the problem.