Here's my task.
Output:
A single PDF containing a series of customer documents consisting of pages from PDF 1 followed by pages from PDF 2, with appropriate backgrounds applied to the pages of PDF 1, and different backgrounds for the pages of PDF 2.
Input:
1) 2 PDF's (PDF 1 and PDF 2) prepared with variable data for a list of customers.
2) An index that tells me where each customer's pages start and how many pages the customer has in each of the PDFs
4) A set of static background PDFs that get applied to the customer pages. In my current project, there are 4 static background PDFs that correspond to the odd pages of PDF 1, the even pages of PDF 1, the odd pages of PDF 2, and the even pages of PDF 2.
Current method:
1) Open a PDF document
2) Begin looking at the index of customers
3) For each customer, add a page from PDF 1, apply the appropriate background, and repeat until done with the pages for this customer for PDF 1. (In the case of my current data, I add an odd page from PDF 1, apply the background, add an even page from PDF 1, apply the background, and repeat until done with the pages for this customer for PDF 1.)
4) Repeat #3 for PDF 2
5) Repeat #3 and #4 for all the customers
6) Draw the PDF document
The reason I didn't use the even/odd template is because not all the projects to be handled by this software fit that model. Since the even/odd template has to be applied to the whole document, I can rearrange my software for my first project to use the even/odd template to apply the backgrounds first, then assemble the two PDFs. The above sequence is more general, though, and I may not always have even/odd pages to work with. Any suggestions that would manage memory correctly while assembling arbitrary arrangements of pages with backgrounds would be appreciated.
Thanks,
Rick