Hello all,
Thank you for your posts. It is indeed possible to create an incremental dynamic stamp using Editor plus. It is a little bit convoluted, so I have attached an example. Simply save the attached PDF under C:\Users\<user>\AppData\Roaming\Tracker Software\PDFXEditor\3.0\Stamps and restart the editor to see this counter. I admit it is a very simple example - If you are interested in creating your own, please see the steps below.
1- First, you must create a new PDF document on which you will create the visual aspects of the stamp. I have created a standard 8 1/2 X 11 page and placed a circle annotation on to it:
This circle will be the border of the new stamp. Make sure to go to Comments> Flatten Comments before moving on to the next step.
2- Now, save this file to a convenient location (e.g. your Desktop). For the purpose of these instructions, we shall call it Counter2.pdf.
3- Close Counter2 leaving the Editor launched. Go to Tools> Comment and markup tools> Stamps pallet, and choose "New From File" and chose Counter2.pdf.
4- In the next window, name the stamp to your desire (I have named it Counter2). Then choose "Add new" next to Target collection. I have named the new collection "Counters". Then click OK.
For these next steps, you will need either an Editor Plus or PDF-XChange PRO license.
5- Within windows explorer (aka File Explorer), navigate to C:\Users\<user>\AppData\Roaming\Tracker Software\PDFXEditor\3.0\Stamps. You can type the following in order to jump to the Roaming subfolder:
6- Within the \Stamps directory, you should see a PDF resulting from your new stamp collection. Order by newest to find Counter2. Once you are confident that you have found the correct stamp PDF, I recommend renaming it for convenience's sake. I have named it "Counters.pdf" because this file contains the aforementioned stamp collection.
7- Close the Editor.
8- Move "Counters.pdf" to your desktop, then open it in the Editor.
9- Go to Form> Edit Form and place a text field in the location you wish the number to show:
Tip: In the properties toolbar, you can change the border fill to none, so that the boundaries of the form field are not shown on the stamp.
Tip: Change the Text alignment to centred so that the number is centred in the stamp.
11- Activate the properties pane (View> Other panes> Properties)
12- Make sure you select the text field with the Edit Form function active. Then look for the "Value Calculation" property. It should be at the bottom. Set it to "Custom action".
13- You will now see an additional option populate called "Run a JavaScript". Click on the
... button to activate the JavaScript Console.
14- Paste the following script into the JavaSchript consol.
Code: Select all
if (event.source.forReal && (event.source.stampName == "TCS9kAUOm4Abn56QZCOZE3"))
{
var counter = 0;
if (typeof event.source.source.info.stampCounter != undefined)
{
counter = event.source.source.info.stampCounter;
}
counter++;
event.source.source.info.stampCounter = counter;
event.value = counter;
}
else
{
event.value = 1;
}
15- Save and close Counters.pdf and the Editor.
16- Move Counters.pdf back into C:\Users\<user>\AppData\Roaming\Tracker Software\PDFXEditor\3.0\Stamps
17- Were this a typical dynamic stamp, you would be done here. However, to ensure the counter works correctly, and for each document, there are a couple more steps.
18- Launch the Editor and create a new document. Then go to the stamps pallet and place Counter2 anywhere on the page.
Leave the stamp selected and use the keyboard shortcut Ctrl+J to launch the JS console again.
19- Paste the following code into the JS console, then click run:
20- The results should look similar to this, however, the code is generated by your PC, therefore will differ from mine:
21- Copy this key to your clipboard, then close the Editor.
22- Move Counters.pdf back to your Desktop then open it in the Editor.
23- Activate the Edit form tool and select the text field. Go to the Properties pane and select
... next to the "Run a JavaScript" and replace "TCS9kAUOm4Abn56QZCOZE3" located on line one, with the string gathered in steps 20/21.
24- Save Counters.pdf, and close the Editor. Move Counters.pdf back into C:\Users\<user>\AppData\Roaming\Tracker Software\PDFXEditor\3.0\Stamps
You should now be able to use this counter2 stamp!
I hope this helps!