My objective: What I want to do is actually simple. I want to replace the pages in a PDF ("the original pdf") with pages from another PDF ("the new pdf") but retain the crop margins of the original pages. Both the new and original PDF has the same number of pages (about 600 pages). The crop margins differ from page to page.
I can't do so directly as replacing a page replaces the crop margins of the original page with the crop margins of the new page. Neither is there an option to export and import crop margins.
The workaround I am using is do insert the new page into the original page as a background (with the "scale relative to target page" option unchecked), and deleting the page (it has not been OCRed, so it is just an image) object, revealing the underlying inserted page. This works, but only for 1 page, because I can only select, in the insert background dialog box, one page out of the new PDF to insert as background into the original PDF.
What I want to do instead is to insert as background corresponding pages of the new PDF into the pages of the original PDF, i.e. p 1 to p1, p2 to p2.
To try to get around this, I extracted all the pages in the new and original PDF as separate files. My idea is to create an action that will batch insert, the single paged PDFs in one folder as background into the corresponding single paged PDFs in another folder, i.e. insert 1.pdf in Folder A as background for 1.pdf in Folder B, 2.pdf in Folder A as background for 2.pdf in Folder B and on.
This is where I am stuck. How can I define an action to do that? Or can this be done by script? I have no experience with scripts.
Help!
Many thanks,
Jay