how to replace certain pages with one page at the same time ?
Copy link to clipboard
Copied
Hi
I have pdf file of 400 pages , I want to replace certain pages with one page from another file
Ex : I want to select page 4 , 16 , 50 , 60 at the same time , replace them with one page
I mean that the page from the the other pdf file is to duplicate , put instead of the selected pages
Thanks
Copy link to clipboard
Copied
Any Help Here !!
Copy link to clipboard
Copied
Do either of the pages (old and new) have form fields or comments that you want to keep or add? Your answer depends on the solution.
Copy link to clipboard
Copied
No , It don't contain any form fields or comments
Copy link to clipboard
Copied
With the New Acrobat disabled, open the pages panel on the right, right-click a page and select Replaces Pages. Browse your hard drive for the file containing the page you want to use to replace the page in the document. Select the correct pages to replace and replace with. Repeat for the other pages.
Copy link to clipboard
Copied
Thanks for your replay
Sure , I made it but I don't want to repeat the whole process for each page
Is there such a script to do this step automatically not manually ?
Copy link to clipboard
Copied
First get the path to the document you are using for a replacement by opening it and running the following script in the console:
this.path;
Next, open the document for which the pages will be replaced. Run the following script in the console, adding the path from the previous step betweent the quotes:
var pth="";
Run the following lines of code in the console:
this.deletePages(3); this.insertPages(2, pth, 0,0);
this.deletePages(15); this.insertPages(14, pth, 0,0);
this.deletePages(49); this.insertPages(48, pth, 0,0);
this.deletePages(59); this.insertPages(58, pth, 0,0);
The 0,0 is the page range of the document to insert (that is, page 1). If it is another page, change these using the zero-based index of the page.
Or you can use this:
this.replacePages(3, pth, 0,0);
this.replacePages(15, pth, 0,0);
this.replacePages(49, pth, 0,0);
this.replacePages(59, pth, 0,0);​
This also assumes page 1 of the source document is used.
Copy link to clipboard
Copied
Thanks for your great help
Excuse me , I need a clearly understanding about 2 files
Firstly when getting the path ... do you mean file that have multiple pages or the file that contain the page the I will use it to replace
I have misunderstaing , It is the first time to use console in acrobat pro
sorry
Copy link to clipboard
Copied
The file that contains the page you will be using.
Copy link to clipboard
Copied
I got this error
ReferenceError: pth is not defined
1:Console:Exec
undefined
Copy link to clipboard
Copied
You have to run the first line in the console when you are in the document for which the pages will be replaced.
Copy link to clipboard
Copied
Are you mean ?
var pth="path";
I run it : error undefined
Copy link to clipboard
Copied
Undfined is correct when definining a variable. Now run the rest of the script.
Copy link to clipboard
Copied
when I run the rest of the script
for ex :
this.replacePages(3, pth, 0,0);
this.replacePages(4, pth, 0,0);
It replaced page 5 only , other pages remain no change
Is there a simplifier method to delete pages using the script directly
I mean as a beginner , when I wote in script page number 5 ... it directly delets this page
and Is this script can have a simple interface like indesign , photoshop , and illustrator
Thanks for your patience
Copy link to clipboard
Copied
Page numbers are zero-based so you have to subtract 1 from the actual page number (example: 0 is page 1, 1 is page 2, etc.). It sounds like you only ran the last line of the code. To run all lines you have to select them all before pressing the Enter key on the number keypad (or Ctrl + Enter). Other wise you have to run each line by putting the cursor on each line and pressing the num keypad Enter key. Why do you want a script? You can add the pages in the pages panel by dragging your 1-page file into the panel, then delete the page it is going to replace by selecting it in the pages panel and pressing the delete key.

