• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Why does not the script work

New Here ,
Aug 08, 2019 Aug 08, 2019

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

TOPICS
Acrobat SDK and JavaScript , Windows

Views

777

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2019 Aug 09, 2019

Copy link to clipboard

Copied

I miss a { after else.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2019 Aug 09, 2019

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 09, 2019 Aug 09, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2019 Aug 09, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2019 Aug 09, 2019

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:

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 09, 2019 Aug 09, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2019 Aug 09, 2019

Copy link to clipboard

Copied

Oups.

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

Many thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2019 Aug 09, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2019 Aug 09, 2019

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2019 Aug 09, 2019

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:

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2019 Aug 09, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2019 Aug 09, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2019 Aug 09, 2019

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2019 Aug 09, 2019

Copy link to clipboard

Copied

It should appear here:

Unbenannt.PNG

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 09, 2019 Aug 09, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2019 Aug 09, 2019

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 09, 2019 Aug 09, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2019 Aug 09, 2019

Copy link to clipboard

Copied

This is the viewer Adobe Acrobat.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines