It is not possible to merge existing PDFs together with PDFreactor without generating a PDF from an HTML source document. However, there is a workaround for that. You can convert an empty HTML document to PDF and then merge existing PDFs with it. This can be done using the following code (Java):


PDFreactor pr = new PDFreactor();
Configuration conf = new Configuration();

// an "empty" HTML document
conf.setDocument("<html>");

// make the document really small so that the PDFs can overlay it
conf.setUserStyleSheets(new Resource().setContent("@page { size: 1in 1in; }"));

// Set merge mode to "Overlay" to overlay the "empty" page over the existing PDFs
conf.setMergeMode(MergeMode.OVERLAY);

// Merge the existing PDFs
conf.setMergeDocuments(
    new Resource().setUri("url/to/documentA.pdf"),
    new Resource().setUri("url/to/documentB.pdf"),
    new Resource().setUri("url/to/documentC.pdf"));

pr.convertAsBinary(conf);