Skip to main content
Participant
March 21, 2018
Answered

Save ONLY Custom Properties from Plugin - Acrobat SDK 9

  • March 21, 2018
  • 2 replies
  • 511 views

I have a plugin that adds and removes custom properties to and from a PDF.  After my plugin changes the custom properties, I want it to also save the PDF but I only want the custom properties portion of the document to be updated.  The reason is that if the user has edited the PDF but not saved those changed then I don't want to force those changes to be inadvertently saved.  In otherword, I need my changes to custom properties to be separate from the user's changes to the document or pages or other components (unless of course they just do a normal save, or edit properties and save, then it doesn't matter).

Is it possible to save ONLY the Custom Properites of the AVDoc from a plugin from SDK 9?

I can use AVDocDoSave to save the document entirely, and silently, but I'm afraid that will confuse users because it forces them to save their current work without realizing it and they may not have wanted that to happen.

Thanks

This topic has been closed for replies.
Correct answer Thom Parker

The only way to do that would be to basically undo all the user changes, then redo them after the save. I don't think this is entirely possible.

A better strategy would be for the plug-in to save the plug-in property changes (not the PDF) to a persistent storage location.

2 replies

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
March 22, 2018

The only way to do that would be to basically undo all the user changes, then redo them after the save. I don't think this is entirely possible.

A better strategy would be for the plug-in to save the plug-in property changes (not the PDF) to a persistent storage location.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Legend
March 22, 2018

This is impossible in practice and in concept.