[javascript] metadata for pages and annotations

Please post any ideas or requests for new features here for the End User Version of PDF-XChange (printer Drivers)

Moderators: Daniel - PDF-XChange, PDF-XChange Support, Vasyl - PDF-XChange, Chris - PDF-XChange, Sean - Tracker, John - Tracker Supp, Ivan - Tracker Software, Stefan - PDF-XChange, Tracker - Clarion Support, Support Staff, moderators

Post Reply
Mathew
User
Posts: 441
Joined: Thu Jun 19, 2014 7:30 pm

[javascript] metadata for pages and annotations

Post by Mathew »

I don't know if it's the correct solution, but if there were access through javascript to metadata that's associated with pages, and metadata that's associated with annotations, that would solve some issues I've been bumping up against with scripting. I'll describe the particular use cases below, but I'm sure there would be other uses too:

Pages
  • I need a way to uniquely identify pages so that a tool to merge documents can know if a page has been moved/deleted/added. I was thinking about adding a hidden annotation outside the cropbox, but that's really messy because they would show up in the list of annotations.
  • When merging documents, it's difficult to figure out if an annotation has been deleted in one document, or added in a second document. If one could save metadata with each page, then data about the annotations on that page could be saved transparently so it would be clear if an annotation was changed/added/deleted on that page. My current workaround is to create a separate file, but saving by page is much less fragile (if a page gets moved, the data goes along with it).
Annotations
  • When making a built-in annotation type behave differently (such as polylines or ink annotations), it would be really useful to have a way to store information about the annotation so that when subsequently running the tool, it will be able to access that information. This is a less difficult one to work around than the above, because there is document metadata or the .info property which could be used to store JSON data associated with the annotation name & page, but again it's quite messy in that it's information that a user doesn't necessarily want to see; if the annotation gets moved to a different page it would be difficult to track it; and if its name gets changed then there would be no way to correlate the data.
  • Example use cases are: For the hatch tool, storing information about the boundaries of the hatch, so that the hatch can be edited again later without relying on the original markups that were hatched around. Similarly, for a curved line, saving the original control line data so that the curve can be edited later. If creating complex linetypes that include letters or symbols along the line, storing the text and spacing of symbols to allow editing of the line.
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 10168
Joined: Wed Jan 03, 2018 6:52 pm

Re: [javascript] metadata for pages and annotations

Post by Daniel - PDF-XChange »

Hello, Mathew

Thank you for the post, I have forwarded this on directly to the Dev team for comments. As soon as we hear back from them we will post here.

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Post Reply