5. Add a Cover Page to a PDF Document
You have a collection of PDF files.
You want to put those files up on the website, but not before adding a “cover-page” that indicates their source and your company's contact information.
The cover page is also a PDF file, so your objective is to insert a single page at the beginning of each of the source documents.
You can use DocumentAlchemy's “join documents” REST endpoint to insert that cover page.
For example, to add a cover page to a single PDF file, you can use the following curl command:
TITLE-PAGE.PDF is your cover page and
DOC_BODY.PDF is the document you want to add the cover page to.
Here's a shell-script that will add a cover page to each document listed on the command line:
Save the script as
add-cover.sh, make sure it is executable (
chmod a+x add-cover.sh) and run it like this:
./add-cover.sh cover-page.pdf documents/*.pdf
to create a copy of each PDF file in
Note that the generated files will be found in the same directory as the source file, with the string
covered- added to the file name.
EDIT: See “Add a cover page to a PDF document” in “Five Things You Can Do With the DocumentAlchemy API - Command-Line Interface Edition” for an even easier interface to this functionality.