Access Metadata from XDP

In this post, I’ll address a use case where in profile you want to access data from the rendered form. Sometimes, you might want to access metadata associated with the form. You can add metadata to the form using the Form Properties option of the File menu in LiveCycle Designer.
form_prop1

 

You can add title, description and also custom properties like shown in the picture below. This meta data makes your form more accessible as this info is read by screen readers also. More info on designing accessible forms can be found at Accessible Mobile Form.

form_prop_diag

 

Title specified in this data will appear in the title bar of the Adobe Reader when you open the pdf form. If you want to show the title in Html Form, you can leverage the FormBridge APIs to retrieve the form data.

1
2
3
4
5
6
7
8
9
10
$(function(){
    window.formBridge.connect(
        function(){
            var titleResult = window.formBridge.getFieldProperties("xfa.form..desc.title","value");            if(titleResult && !titleResult.errors && titleResult.data && titleResult.data[0]){
                $(document).attr('title', titleResult.data[0]);
            }
        }
    );
});

XFA Form stores all the metadata associated with the form in <desc> element of the root level subform. Since the name of your root level subform can be different for all the forms, you are rendering with a profile, you have to use a form independent SOM expression. That is why at line 4 of the script, you can see the double dot notation.
In the similar way you can extract any meta data present in the form and use it in html form.

3 Responses to Access Metadata from XDP

  1. manikandan says:

    Hi,
    I am working with SAP ByDesign, Can you help me with Adobe Live Cycle Designer for SAP ByD.
    Thanks in Advance.
    BY
    Manikandan.V

Leave a Reply

Your email address will not be published. Required fields are marked *


4 − = two

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>