Expand my Community achievements bar.

SOLVED

How to get the metadata in Designer?

Avatar

Former Community Member

In Acrobat, I can get the metadata by "this.metadata".

The Designer's Help  said: use "xfa.form.desc" to instead of "this.metadata".

The "desc" has a method "metadata(Integer para)" to return the metadata's info.

I use the code "xfa.form.desc.metadata(0)" in designer.

But alert the error "GeneralError :Operation failed".

Who can tell me how  to get the metadata in Designer?

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Use

var Meta = event.target.metadata;

xfa.host.messageBox(Meta, "Metadata of this form", 3,0);

But this is not a good method, as the messageBox may be to small to display all information!

View solution in original post

4 Replies

Avatar

Level 10

The equivalent to "this" in Designer is "event.target".

So event.target.metadata; should work.

Avatar

Former Community Member

Thank you,radzmar.

I use the "xfa.host.messageBox(""+xfa.event.target.metadata);" in a button's clickEvent.

But the error is same.

My target is:

Now,I have a blank PDF create by Designer.

Only one button in this PDF.

When I click the button,then show the metadate'info for me.

My code is:

try{
var tDesc=xfa.form.desc;
    xfa.host.messageBox(""+tDesc.metadata(0),"",3);
}catch(e){
xfa.host.messageBox(""+e);
}

But it is incorrect;

I want to get a simple about get metadata info.

the metadata info like:

<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
         <xmp:MetadataDate>2010-11-18T07:37:45Z</xmp:MetadataDate>
         <xmp:CreatorTool>Adobe LiveCycle Designer ES 9.0</xmp:CreatorTool>
         <xmp:ModifyDate>2010-11-18T13:14:40+08:00</xmp:ModifyDate>
         <xmp:CreateDate>2010-11-18T11:25:05+08:00</xmp:CreateDate>
      </rdf:Description>
      <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
         <pdf:Producer>Adobe LiveCycle Designer ES 9.0</pdf:Producer>
      </rdf:Description>
..................

Avatar

Correct answer by
Level 10

Use

var Meta = event.target.metadata;

xfa.host.messageBox(Meta, "Metadata of this form", 3,0);

But this is not a good method, as the messageBox may be to small to display all information!

Avatar

Former Community Member

Thank you very much!

I have get the metadata.