Copy link to clipboard
Copied
My question, why is the following script not running within the "Additional Metadata"? Entries in the document properties, e.g. Title, author, etc. work with it.
The script:
function CopyrightStatusSetzen(){
var EingabemdCopyrightStatus = app.response({
cQuestion: "Geben Sie die CopyrightStatus ein:",
cCopyrightStatus: "CopyrightStatus eingeben",
cDefault: "1975"});
if(EingabemdCopyrightStatus == null){
}
else
this.info.CopyrightStatus = EingabemdCopyrightStatus;
this.layout = "MultiplePage";
// this.layout = "SinglePage";
}
app.addToolButton({
cName: "SetCopyrightStatus",
cLabel: "CopyrightStatus setzen",
cTooltext: "CopyrightStatus setzen",
cEnable: true,
cExec: "CopyrightStatusSetzen()"});
could someone help me?
System: Windows 7; Acrobat DC
Thank you and best regards
Copy link to clipboard
Copied
I miss a { after else.
Copy link to clipboard
Copied
If I add one more I get a SyntaxError 15 in line 16
Copy link to clipboard
Copied
Doc.info sets fields in the Info dictionary, as documented. Additional metadata is not stored there, or displayed. You can set extra fields in the Info dictionary but it won’t be merged into metadata. Standard names are automatically merged into the XML metadata, which you can read and write as a packet using Doc.metadata.
Copy link to clipboard
Copied
Thank you for your answer, but what does that mean? Is it not possible to insert data in the "additional metadata"?
Thanks
Copy link to clipboard
Copied
https://forums.adobe.com/people/Test+Screen+Name wrote
Additional metadata is not stored there, or displayed.
That's not true. If you set a custom property under this.info it is saved and is displayed later on, under File - Properties - Custom.
For example, I've ran this code:
this.info.CopyrightStatus = "RESERVED";
Then saved and closed the file, then re-opened it, and this appears:
It's also a part of the file's raw metadata XML:
Copy link to clipboard
Copied
It means your code cannot work, and to update additional metadata requires a lot of study and development.
I recommend studying the PDF Specification, ISO 32000-1, to understand the different types of metadata. This may lead into study of XML in general and XFA metadata. Then you would need to update the XML metadata somehow.
So I do not say it is impossible. But you may not have the time or resources to do it.
Copy link to clipboard
Copied
Oups.
Thanks, that's so extensive I did not know.
Many thanks
Copy link to clipboard
Copied
Hi try67,
yes that's right, but I need the entries in the Description tab (Additional metadata), and that does not seem to be that easy or impossible?
Love from
Copy link to clipboard
Copied
Ah no, there you can only use the built-in properties, not ones that you've added yourself.
Copy link to clipboard
Copied
Actually, that's not quite true... If you go to Properties - Description - Additional Metadata - Advanced and expand the last item in the list, you'll see your custom properties:
Copy link to clipboard
Copied
Hallo try67,
ja das stimmt, aber ich brauche wie gesagt die Eingaben in den Dokumenteigenschaften in dem Feld: Beschreibung (zusätzliche metadaten) und das scheint nicht zu funktionieren?!
Vielen Dank
Copy link to clipboard
Copied
Hello try67,
yes that's true, but I need the input in the document properties in the field as described: Description (additional metadata) and that does not seem to work ?!
Many thanks
Copy link to clipboard
Copied
I don't quite understand where you want it to appear...
Copy link to clipboard
Copied
It should appear here:
Copy link to clipboard
Copied
You should notice that the data is in the XML format and that is what needs to be edited. This property was added in Acrobat 7.0 and one needs to use the XMLData object and the XMLData.parse method.
This is not a beginner's project.
Copy link to clipboard
Copied
In order to do it you will need to edit the XML code of the metadata property.
My suggestion is to print out this string before applying these properties, and then after, and comparing them. That will give you an indication of what you need to change in order to achieve it. As mentioned, this is not a simple project.
Copy link to clipboard
Copied
What app is that? Looks like it may be a separate general XMP viewer. If so, it won't be looking at PDF/X metadata...
Copy link to clipboard
Copied
This is the viewer Adobe Acrobat.