Print Page | Close Window

Rotate a Stamp

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: JavaScript
Forum Description: Discussions relating to the use of JavaScript within PDF.
Printed Date: 12 Dec 2019 at 12:38pm
Software Version: Web Wiz Forums 11.10 -

Topic: Rotate a Stamp
Posted By: pmcnulty
Subject: Rotate a Stamp
Date Posted: 24 May 2017 at 11:42pm
Hi I'm trying to create a stamp where when the user drags the stamp onto the document it runs JavaScript to create a popup dialog asking the user for an angle to rotate the stamp and the stamp is placed on the document with that rotation. I have created and can run the dialog but can't work out how to access the properties or get the stamp to rotate
the code I have is :

var Consentdialog = 
   //this function is fired on pressing ok
   commit: function(dialog)
      var data =;

      name:"Containment Diagram",
            type: "static_text",
            bold: true,
            name: "Enter angle from north (degrees): "
            item_id: "stxt",
            width: 300,
                  type: "edit_text",
                 multiline: false,
            type: "gap",    //Add a small vertical gap between
            height: 10      // fields and buttons
            type: "ok_cancel",
            ok_name: "Ok",
            cancel_Name: "Cancel"

if(event.source.forReal &&
   ((event.source.stampName == "h2yaK916D7gKH6wiDDHfe0")))

   if(Consentdialog.degrees !="")
//change stamp rotation


Posted By: try67
Date Posted: 28 May 2017 at 11:09pm
You can't do that, because when the code is executed the stamp object doesn't exist yet.
One possible workaround is to add a time-out that executes a code to rotate the last annotation added to the file some time after the dialog is closed, maybe after 500ms or so.

- Acrobat Expert - Contact me personally at
Check out my custom-made scripts website:

Posted By: pmcnulty
Date Posted: 29 May 2017 at 1:22am
Thanks try67
was hoping I would be able to access the underlying stamp object that was being place will have a look at a different approach

Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 -
Copyright ©2001-2017 Web Wiz Ltd. -