Java code to create multi-page pdf files from-scratch and apply a template to any/all pages (header/footer, etc)
This code was written for Java 8 and Apache's pdfbox/fontbox 2.0.15 https://pdfbox.apache.org/
Please see the license notice in the .java file.
Before running be sure to check the value of the FILEDIR variable - this is where it expects to find the template file (named 'letterhead.pdf') and where it will write out any files created.