The attached Groovy scripts, show two different ways to use the PDFBox library (Apache PDFBox | A Java PDF Library ) to merge PDF files.
For either script, you will need to download the latest pdfbox-<version>.jar file from the site above, install it into the "<atom_install>/userlib/script" directory, and restart your Atom.
- This script is configured to take multiple AtomSphere documents as input. Each of these documents contain a list of fully qualified ( includes pathname ) PDF files to merge, one file on each line.
- The output file will be created based on a Dynamic Document Property "outputFileName"
- This script expects multiple AtomSphere documents, each containing a binary PDF File, and outputs a single AtomSphere doc, containing the merged PDF File.
- This script may be more appropriate if you are pulling those PDF Files from a web service, or from multiple sources, or if you need to pass the PDF output to the rest of your process.
These are just two examples that highlight the capabilities of using PDFBox within AtomSphere. They are examples, and do not contain much error handling. Based on your specific needs, they should be modified and tested accordingly.