Skip to main content
Participating Frequently
August 9, 2019
Question

Why does not the script work

  • August 9, 2019
  • 8 replies
  • 1111 views

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 has been closed for replies.

8 replies

Legend
August 9, 2019

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

Bernd Alheit
Community Expert
Community Expert
August 9, 2019

This is the viewer Adobe Acrobat.

Participating Frequently
August 9, 2019

It should appear here:

Inspiring
August 9, 2019

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.

Participating Frequently
August 9, 2019

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

try67
Community Expert
Community Expert
August 9, 2019

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

Participating Frequently
August 9, 2019

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

Participating Frequently
August 9, 2019

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

try67
Community Expert
Community Expert
August 9, 2019

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

try67
Community Expert
Community Expert
August 9, 2019

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:

Legend
August 9, 2019

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.

Participating Frequently
August 9, 2019

Oups.

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

Many thanks

Legend
August 9, 2019

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.

Participating Frequently
August 9, 2019

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

Thanks

Bernd Alheit
Community Expert
Community Expert
August 9, 2019

I miss a { after else.

Participating Frequently
August 9, 2019

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