I need a function in PHP, that can overlay 2 existing pdfs.
PDF #1 is only 1 page and shall be the "template" for the final document, i.e. it shall be the background for each page of the final document.
PDF #2 can have a various No. of pages, which overlay the template. If PDF #2 has 4 pages, the final document will have 4 pages too.
See an illustration attached.
Important: The file size of PDF #1 (template) shall not be multiplied, if the resulting file has more than 1 pages.
I think, what I need can be done using the FPDI library.