Copy link to clipboard
Copied
Copy link to clipboard
Copied
The best way to do this is to create a custom dynamic stamp. Which you can read about here:
https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm
It could also be done by using a combination of a circle annotation and a textbox annotation.
Either way you'll need to understand PDF page coordinates to create a script for automating the placement of these annotations.
Which you can read about here:
https://www.pdfscripting.com/public/PDF-Page-Coordinates.cfm
Automating this process is not a particularly difficult task, but it does require some advanced skills.
Copy link to clipboard
Copied
The circle can be created using a "Circle"-type comment, which can be added using the addAnnot method.
The text can also be a comment, or a text field, which can be added using the addField method.
Copy link to clipboard
Copied
The best way to do this is to create a custom dynamic stamp. Which you can read about here:
https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm
It could also be done by using a combination of a circle annotation and a textbox annotation.
Either way you'll need to understand PDF page coordinates to create a script for automating the placement of these annotations.
Which you can read about here:
https://www.pdfscripting.com/public/PDF-Page-Coordinates.cfm
Automating this process is not a particularly difficult task, but it does require some advanced skills.
Copy link to clipboard
Copied
The circle and number will be placed on the same location of each page. Would it make the Scipt a bit eaiser?
Copy link to clipboard
Copied
Yes, for example one technique would be to place the first annotation manually, then use the code you've already seen to copy the annot by copying the annot props and changing the page number.
But the circle with number presents a challenge, since you'll need to create two annotations. I'd suggest this. Manaully place a circle on first page. Select it, then run this script in the console window. Or make it a folder level function.
// Place number in circle
props.type = "FreeText";
props.contents = inc.toString();
inc++;
this.addAnnot(props);
// Add circle number combo to all pages
for(var i=1;i<this.numPages;i++){
props.page = i;
props.type = "Circle";
this.addAnnot(props);
props.type = "FreeText";
props.contents = inc.toString();
this.addAnnot(props);
inc++
}
This method is a bit crude and adhoc. You'll notice that the number is not centered. One fix would be to add the text annot up front and select both the initial circle and number, then use separate props objects for each. There are lots of other ways this could be done. But I have to go back to my original comment. A custom dynamic stamp is the best solution.
Copy link to clipboard
Copied
I assume you don't have the original file that created the pdf, where you could add the page numbers.
Are you comfortable with InDesign? If so here is another work-around;
Create a new InDesign file at the desired page size and place a round text box on the parent page (AKA master page) filled with an auto page number (Type> Insert Special Character> Markers> Current Page Number). Set the text alignment to center and the text frame option- vertical justification- align to center. Now place your existing pdf into all pages using the included script "Place multipage pdf", this will create a multipage InDesign file with correct page numbers, export to a new pdf. I can provide better step by step instructions, if you are interested.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now