My Incremental Dynamic Stamp would lose the trace if I use Ctrl + Z or delete a previous stamp.

New Here ,
Mar 15, 2021 Mar 15, 2021

Copy link to clipboard

Copied

I am using a JavaScript Code in order to have a let’s say incremental stamp in my adobe acrobat pro dc, it works well and the stamp counts from a desired start number.

The problem with the code is- whenever I delete a previous stamp, the one that comes after, does not see this deletion and counts like no stamps have been deleted. Just to make sure that I have explained the problem correctly, let me give an example here; assume I have stamped three times in a row: stamp #1, Stamp #2, Stamp #3. And at the end, when I delete the Stamp #3, continuation of the stamping process would leave me with something like this: Stamp #1, Stamp #2, Stamp #4! Something that I do not want at all.

I know I should be able to save the incremented values somewhere to make the acrobat able to read it before trying to determine the stamp number, but I do know how.

I would be thankful if you guys help me with this problem? By the way, I am not un-familiar with the JavaScript.

Best,

TOPICS
Create PDFs, How to, JavaScript, PDF forms

Views

120

Likes

translate

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
Adobe Community Professional ,
Mar 15, 2021 Mar 15, 2021

Copy link to clipboard

Copied

What should happen when you delete stamp #2 ?

Likes

translate

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 ,
Mar 15, 2021 Mar 15, 2021

Copy link to clipboard

Copied

Thank you very much for your quick and helful response;

The question that you have asked, made me think more about the task the I expect this stamp to perform for me. I am kind of feeling some sort of logical issues with the thing that I want; I mean, what should really happen if someone delete a stamp from the completely sored stamp list. I think it should be possible for someone to develop a code that makes the number of stamps thoroughly sorted from the first stamp to the last one after deletion of a particular stamp, but I do not want to go that far (I think the code would be complecated in that case).

At the moment, you question has led to another question in my mind; would you please give me some hint to modify the code so that the new stamp deletes automatically the last stamp of the same kind so that, there would be just one stamp of that type in the entire document?

Best,

Likes

translate

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
Adobe Community Professional ,
Mar 15, 2021 Mar 15, 2021

Copy link to clipboard

Copied

Stamp scripts are very limited. A stamp script cannot get info on or affect any other stamps. So, a stamp script cannot delete another stamp. 

 

Now about your first question. What is the script used for the increment? The increment value has to be stored somewhere and then the stamp script increments the value. To decrement the count when a stamp is deleted would require a script that triggers when the stamp is deleted. There is no such script trigger.

 

However, there is a way to manage the stamps the way you want. It just can't be done from a stamp script. To do this you need an automation script. You'll need to learn much more about stamps, Acrobat, and JavaScript to do this.

https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm

 

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

Likes

translate

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 ,
Mar 16, 2021 Mar 16, 2021

Copy link to clipboard

Copied

Thanks.

This is the code I am using. I have found it online. today, I searched again to find the name of the website from which I have got it, but I failed to find it. At this moment, I am not even sure if there is any copyright behind publishing it.

 

Here is the code:

code2.png

 

Please let me know what you think and if you see any problem with this code.

Likes

translate

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
Most Valuable Participant ,
Mar 15, 2021 Mar 15, 2021

Copy link to clipboard

Copied

It's an interesting idea, and I believe it's doable, but it will require the development of a custom-made script, which I could create for you, for a fee. You can contact me privately via [try6767 at gmail.com] to discuss it further.

Likes

translate

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 ,
Mar 16, 2021 Mar 16, 2021

Copy link to clipboard

Copied

Thanks for your offer.

Best,

 

Likes

translate

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