Copy link to clipboard
Copied
Hi folks.
First time posting in this community.
I have a large library of PDF's. I have been creating and populating custom document metadata for each file using javascript containing barebones code such as:
this.info.Name1 = "ACME Company";
this.info.Name2 = "1500";
this.info.Name3 = "2021-01-01"; . . .
and then run it as a batch script.
Through occassional sloppy coding, sometimes the custom property becomes
this.info.Nmae1 = "ACME Company"; //or//
this.info.2Name = "2000"
To fix these mistakes, I'll write a script with the line
this.info.Nmae1 = null;
this.info.2Name = null;
I checked this snippet in the javascript console and I can see it has removed the offending document data object but the change is not persistent. After I save and close the document, it remains. After each console entry I check it in the Documents Property → Custom Tab to discover it has not been removed.
In some documents, I have a long list of metadata objects that are not really related to the document and become orphans.
Manually deleting the offending entry in the Document Properties modal box using the Delete button is the only methodology I that works. Not a very efficient way to go about this task.
Is there document method that will remove these orphaned metadata?
Copy link to clipboard
Copied
Hi,
You might have more success using the metadata properties as this gives you direct access to the XMP metadata.
Copy link to clipboard
Copied
I researched xmp files after discovering I could use the app directly to save/export metadata , change/delete a line item with an editor followed by importing or replacing it with the edited xmp file.
Coding these steps into a javascript looks a bit more daunting. I took a look at Example 3 which adds a few entries. I'll have a learning curve but your suggestion is probably the best one.