• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Stamping Multiple Pdf files at once - Acrobat XI pro

New Here ,
Nov 03, 2021 Nov 03, 2021

Copy link to clipboard

Copied

Needing to stamp mutiple files at once in the right top hand corner. If someone can write a JavaScript code for that for me.

 

Or is there a way to stamp batches in XI

 

whatever works TIA

TOPICS
JavaScript

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 11, 2021 Nov 11, 2021

Missing Closing curly brace.

 

this.addAnnot({type:"Stamp", page:0, AP:"#DbN0yA0FJHMzRGruq212tA", rect:[560,740,560,740]});

Votes

Translate

Translate
New Here ,
Nov 03, 2021 Nov 03, 2021

Copy link to clipboard

Copied

My stamp name is #DbN0yA0FJHMzRGruq212tA

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 03, 2021 Nov 03, 2021

Copy link to clipboard

Copied

You can do it using the addAnnot method as a part of an Action.

If you want help with the code you'll need to provide additional information such as the exact coordinates for the stamp, and on which pages it should appear.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 03, 2021 Nov 03, 2021

Copy link to clipboard

Copied

Hello, My stamp name is #DbN0yA0FJHMzRGruq212tA and I would like it in the top right hand corner. I am trying to get the stamp on multiple PDF files all at once. So, just the first page stamped of eachfile on the top right hand corner.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 03, 2021 Nov 03, 2021

Copy link to clipboard

Copied

How big do you want the stamp to be?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 04, 2021 Nov 04, 2021

Copy link to clipboard

Copied

it is a stamp I already have made under dynamic stamps

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 04, 2021 Nov 04, 2021

Copy link to clipboard

Copied

I'm aware of that, but the script can't know what's the size of the stamp. It applies it at whatever size you tell it to.

So if you tell me what size it is I could help you write the code to add it using that size. Otherwise I can't help you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 04, 2021 Nov 04, 2021

Copy link to clipboard

Copied

If you apply the stamp to a point, rather than a rectangle, then it takes on it's natural size. So you can just pick a point near the top right corner.

 

this.addAnnot({type:"Stamp", page:0, AP:"#DbN0yA0FJHMzRGruq212tA", rect:[560,740,560,740]|);

 

 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 04, 2021 Nov 04, 2021

Copy link to clipboard

Copied

I am getting this error:

SyntaxError: syntax error
1:Console:Exec
undefined

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2021 Nov 11, 2021

Copy link to clipboard

Copied

Missing Closing curly brace.

 

this.addAnnot({type:"Stamp", page:0, AP:"#DbN0yA0FJHMzRGruq212tA", rect:[560,740,560,740]});

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 10, 2023 Mar 10, 2023

Copy link to clipboard

Copied

@Thom Parker Could you please elaborate on the placement of the Stamp. I have this exact situation. throught this thread i was able to find a line that works for me:
addAnnot({type:"Stamp",page:0,AP:"#MyCustomStamp1", rect:[100,400,100,100]});
but am not abe to fully control the placement. So I need that the Stamp comes in a specific coordinate and with its Natural size and always on the "upright" orientation, regardless of the orientation of  the stamped PDFs 
Thank you in advance. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 10, 2023 Mar 10, 2023

Copy link to clipboard

Copied

LATEST

Finding the right placment point is just working out the math.  

Read this article:

https://www.pdfscripting.com/public/PDF-Page-Coordinates.cfm

 

To compesate for page rotation, add the "rotate" parameter to the "addAnnot" function call to set the stamp rotation to the page rotation.

 

this.addAnnot({type:"Stamp",page:0,AP:"#MyCustomStamp1", rect:[100,400,100,100]}, rotate:this.getPageRotation(0));

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines