When working with stamp annotations in javascript, I know of no property that gives the actual appearance stream of the stamp. This makes it impossible for javascript to duplicate a stamp within a document, or to another document. The property AP is just a name, so using it to duplicate a stamp doesn't work for dynamic stamps, images, stamps that don't exist on the machine...
I'd request that:
Stamp annotations have a read-only property .appearance (or some other name) that returns a stream object.
doc.addAnnot() accepts that property and object when creating a new stamp
This would allow the actual instance of a dynamic stamp, images as stamps, and stamps that don't exist on the current machine, to be duplicated by javascript.
Last edited by Mathew on Sat Nov 02, 2024 12:13 am, edited 2 times in total.
I have passed this request up the chain, so we will need to wait and see what the dev team has to say.
Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
It will require the adding the kind of limited access to native pdf-objects through the JS. We doubt it is a good idea. It may increase the complexity of our internal code and consume significant the memory.
I do not think we are likely to see it eventuate I am afraid.
Best regards
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
Yes - unfortunately for some operations you would need to use an SDK package and the JS supported in our Editor (and by other PDF Tools) does not give full control over the files and their contents.
I may have made this more complex than necessary: What I’m thinking is just a way to duplicate stamps with JavaScript. It’s exactly what copying and pasting a stamp would do but under the control of JavaScript
is there a specific question you have around this or shall we wait to see what you come up with?
Sorry for my lack of clarity: My feature request should be “add a way for JavaScript to copy stamp annotations “.
Even if JavaScript cannot access the underlying appearance data, so long as there’s some mechanism to replicate the stamp instance it would solve this problem.
I apologize: this was a badly written FR. I should have presented the problem (cannot duplicate stamp annotations with JavaScript) and asked for a solution instead of providing my take on a solution.
Thank you for the clarification, After speaking with the Dev team, I am afraid that copy/paste of annotations is not currently something we plan to offer in the JS toolkit.
Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com