Skip to main content
Participating Frequently
Aug 9, 2019 5:47 AM UTC
Question

Why does not the script work

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

This topic is closed to new replies. Start a new post to keep the conversation going.

18 replies

Legend
Aug 9, 2019 1:44 PM UTC

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...

Translate
Bernd Alheit
Community Expert
Community Expert
Aug 9, 2019 1:56 PM UTC

This is the viewer Adobe Acrobat.

Translate
Participating Frequently
Aug 9, 2019 12:08 PM UTC

It should appear here:

Translate
Inspiring
Aug 9, 2019 3:12 PM UTC

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.

Translate
Participating Frequently
Aug 9, 2019 11:40 AM UTC

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

Translate
try67
Community Expert
Community Expert
Aug 9, 2019 11:56 AM UTC

I don't quite understand where you want it to appear...

Translate
Participating Frequently
Aug 9, 2019 11:40 AM UTC

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

Translate
Participating Frequently
Aug 9, 2019 11:15 AM UTC

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

Translate
try67
Community Expert
Community Expert
Aug 9, 2019 11:26 AM UTC

Ah no, there you can only use the built-in properties, not ones that you've added yourself.

Translate
try67
Community Expert
Community Expert
Aug 9, 2019 11:28 AM UTC

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:

Translate
Legend
Aug 9, 2019 7:55 AM UTC

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.

Translate
Participating Frequently
Aug 9, 2019 8:03 AM UTC

Oups.

Thanks, that's so extensive I did not know.

Many thanks

Translate
Legend
Aug 9, 2019 7:29 AM UTC

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.

Translate
Participating Frequently
Aug 9, 2019 7:50 AM UTC

Thank you for your answer, but what does that mean? Is it not possible to insert data in the "additional metadata"?

Thanks

Translate
Bernd Alheit
Community Expert
Community Expert
Aug 9, 2019 7:26 AM UTC

I miss a { after else.

Translate
Participating Frequently
Aug 9, 2019 7:47 AM UTC

If I add one more I get a SyntaxError 15 in line 16

Translate