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
Resource res = new Resource();
res.setContent("@page { size: 1in 1in; }");
conf.setUserStyleSheets(res);

// Set merge mode to "Overlay" to overlay the "empty" page over the existing PDFs
conf.setMergeMode(MergeMode.OVERLAY);
conf.setMergeURLs("documentA.pdf", "documentB.pdf", "documentC.pdf");

pr.convertAsBinary(conf);