Insert multiple PDF pages in existing pages (script
Hello,
I am using the native InDesign script PlaceMultipagePDF.jsx to ... place multipage PDF. All good.
But I would like to place that multipage PDF in the existing pages of my InDesign document and not in new added pages.
I thought it would be a simple edit to the script... and I am sure it is simple, but apparently not simple for me. Anyone could help?
I looked that thought it would be as simple as replacing the following section:
if(myCounter > 1){
myPage = myDocument.pages.add(LocationOptions.after, myPage);
}
app.pdfPlacePreferences.pageNumber = myCounter;
myPDFPage = myPage.place(File(myPDFFile), [0,0])[0];
with the following:
if(myCounter > 1){
myPage = myPage + 1;
}
app.pdfPlacePreferences.pageNumber = myCounter;
myPDFPage = myPage.place(File(myPDFFile), [0,0])[0];
But while myPage returns 2 in the original, with my edit it return undefined.
It turns out that getting the next existing page is harder than my almost-non-existing scripting abilities allow.
Could anyone help? Thanks
N
