Expand my Community achievements bar.

How to fill form fields in PDF binded to dataset?

Avatar

Level 1

Hello All!

I am novice and having troubles with filling fields in PDF. We have used before FDF/XFDF solutions to fill out interactive PDF formulars.

But now I have some PDF where fields are binded to data source like $record.DATASET.FIELDNAME. I see this in the field properties using LiveCycle Designer.

I can fill these fields using XDFD file only if I manually change binding of all fields to "Normal".

But is it possible someway to generate FDF/XFDF or XDP file which can fill these fields without changing field's bindings?

I don't really like to change 100+ fields in 10+ PDF manually every time when the originals will be changed. :-)

I think it's possible, since when I use sample XML data file and preview PDF in LiveCycle the PDF will be filled with the data. How can I reproduce the same programmatically?

Thanks for your help in advance!

5 Replies

Avatar

Former Community Member

Forms that are built in Designer are based on XFA technology and use XML data formats for importing and exporting. The XFDF format is based on XML so these forms can import that type. The issue has to do with structure of the XML. XFDF is flat so when you import the data if the binding is set to normal then any node in the XML that matches a field name will be bound (assuming that the structure of your form is flat also - look at the hierarchy). The binding expression that you have $record.DATASET.FIELDNAME indicates that the FIELDNAME is in a parent container called DATASET. You woudl have to reshape your XFDF data to match this structure. It can be done using xslt but it may be a lot more effort than removing the binding.

Hope that helps

Paul

Avatar

Level 1

Thank you Paul!

Could you please be so kind to help me build the right XFDF file?

I have tried already something like this:

<?xml version="1.0" encoding="UTF-8"?>

<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">

<f href="Form.pdf"/>

     <fields>

          <field name ="DATASET">

               <field name ="FIELDNAME"><value>1</value></field>

          </field>

     </fields>

</xfdf>

But it doesn't work

I also have tried to fill it using xdp

Like

<?xml version="1.0" encoding="UTF-8"?>
<?xfa generator="AdobeLiveCycleDesigner_V8.0" APIVersion="2.5.6290.0"?>
<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/">

<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
   <xfa:data xfa:dataNode="dataGroup"/>
   <dd:dataDescription xmlns:dd="http://ns.adobe.com/data-description/" dd:name="DATASET">
         <FIELDNAME />

   </dd:dataDescription>
</xfa:datasets>


<pdf href="Form.pdf" xmlns="http://ns.adobe.com/xdp/pdf/" />

<connectionSet xmlns="http://www.xfa.org/schema/xfa-connection-set/2.4/">
   <xmlConnection name="Datenverbindung" dataDescription="DATASET">
      <uri>.\blank.xml</uri>
   </xmlConnection>
</connectionSet>
</xdp:xdp>

and blank.xml

<?xml version="1.0" encoding="UTF-8"?>
<DATASET>
   <FIELDNAME>Test</FIELDNAME>

</DATASET>

It doesn't work either.  In both cases the PDF opens but the data will be not populated. :-(

Avatar

Former Community Member

If you open the form in Designer and on the File/Form Properties/Preview panel there is a button to generate default sample data. The data file generated will produce the data structure you need.

Paul

Avatar

Level 1

Yes, I have tried already. It doesn't work still :-(

Can be populating disabled with something else like security settings or something?

Avatar

Former Community Member

Not that I am aware of .....what doesn't work ....the prepopulation of the sample data?

Paul