PDFBox Library

This module (isis-module-pdfbox) provides a wrapper around Apache PDFBox.

How to configure/use


Update your classpath by adding this dependency in your dom project’s pom.xml:


Check for later releases by searching Maven Central Repo.

Supporting encrypted PDFs

Optionally, encrypted PDFs can be handled by adding the Legion of the Bouncy Castle encryption libraries. These can be included in your Maven project using three or so dependencies.

At the time of writing these were:




See the PDFBox documentation for the most up-to-date information.


In the AppManifest, update its getModules() method, eg:

public List<Class<?>> getModules() {
    return Arrays.asList(


This module provides a single service, called PdfBoxService. It has the following API:

@DomainService(nature = NatureOfService.DOMAIN)
public class PdfBoxService {

    public byte[] merge(byte[]... pdfByteArrays) throws IOException { }     (1)
    public byte[] merge(List<File> fileList) throws IOException { ... }     (2)
    public byte[] merge(File... files) throws IOException { ... }

    public void merge(                                                      (3)
            OutputStream outputStream,
            InputStream... inputStreams
        ) throws IOException { }
1 merge an arbitrary number of PDFs, represented as arrays of bytes, to another byte array
2 merge a list of files (to avoid memory issues)
3 merge an arbitrary number of PDFs, represented as an input stream, to an output stream

Known issues

None known at this time.

Do note however that stitching together large PDFs can be memory intensive. This in part is because Apache Isis' Blob datatype is just a wrapper around a byte[] byte array, rather than some sort of stream.


Maven can report modules dependencies using:

mvn dependency:list -o -pl modules/lib/pdfbox/impl -D excludeTransitive=true

which, excluding Apache Isis itself, returns these compile/runtime dependencies:


For further details on 3rd-party dependencies, see: