Expand my Community achievements bar.

How to add metadata to .xdp form

Avatar

Level 1

Hi,

I am currently investigating how to add metadata to an xdp form in LifeCycle Designer. I have read the help contents that Adobe provide however I am unclear as to how exactly the metadata is included with the form. Are there specific elements that are included in the xml? Also is the metadata that is included specific to a field, area, etc within the form?

The metadata I wish to include with the xdp form will contain information regarding the manner in which the form can be used at a later stage, for example whether a form can be printed. In this case I would envisage the following: <printable>true</printable> as part of many different elements within the metadata.

If anyone can offer any insight into this it would be greatly appreciated.

Thanks in advance.

3 Replies

Avatar

Level 10

If you are willing to edit the XML Source view you could add some <desc> elements, e.g.

<field name="HelpButton">
<desc>
         <text name="printable">false</text>
</desc>
.
.
</field>

Then in the prePrint event you could test the value and hide the bits of the form

if (HelpButton.desc.nodes.namedItem("printable") == "false")

If you don't want to edit the xml you could also have a script object function to set the property and then call that in the initialise event of the field

function setProperty(node, property, value)
{
    var item = node.desc.nodes.namedItem(property);
    if (item == null)
    {
     // if the specified property does not exist then create it
     var item = xfa.form.createNode('text', property);
     node.desc.nodes.append(item);
    }
    item.value = value;
    return;
}

and in the Initialise event (if the script object was called Adobe);

Adobe.setProperty(this,"printable","false");

In Designer there is an info window (Windows ... Info) which will display these values if you have put them in the xml but doesn't seem to let you edit them.

Avatar

Level 1

Thanks for the reply,

The way you have described seems to be for individual fields. Is it possible to include metadata that applies to the whole form rather than just an individual field. I have been looking at manipulating the xml. I am not familiar with LiveCycle Designer and as such I was thinking that you could possibly add elements to the xml in the following section:

<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.2.1-c041 52.337767, 2008/04/13-15:41:00 ">

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">

<xmp:MetadataDate>2009-05-15T08:01:47Z</xmp:MetadataDate>

<xmp:CreatorTool>Adobe LiveCycle Designer ES 8.2</xmp:CreatorTool>

<xmp:Name>Test1</xmp:Name>

<xmp:Editable>True</xmp:Editable>

<xmp:Printable>True</xmp:Printable>

</rdf:Description>

<rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">

<pdf:Producer>Adobe LiveCycle Designer ES 8.2</pdf:Producer>

</rdf:Description>

<rdf:Description xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" rdf:about="">

<xmpMM:DocumentID>uuid:59354ca2-6c12-4c0a-aefa-649133cd4486</xmpMM:DocumentID>

</rdf:Description>

<rdf:Description xmlns:desc="http://ns.adobe.com/xfa/promoted-desc/" rdf:about="">

<desc:version rdf:parseType="Resource">

<rdf:value>8.2.1.3158.1.475346.466429</rdf:value>

<desc:ref>/template/subform[1]</desc:ref>

</desc:version>

</rdf:Description>

</rdf:RDF>

</x:xmpmeta></xdp:xdp>

As you may see from the code snippet above I have added three elements: name, editable and printable. The information within these elements would be extracted at a later stage and used by another application to make decisions such as is the form printable, it the form editable etc. Do you know is this the correct place to be adding these elements? The addition of these elements does not cause an error within Designer so I am assuming that there should be no problem accessing / modifying these fields later?

Thanks

Avatar

Level 2

Does the process you described work for you?

I am having the same situation where I need to inject metadata into .xdp form.