Expand my Community achievements bar.

XFDF confused :(

Avatar

Former Community Member
Ok, I'm designing a forms-based system using C# in Visual Studio 2005. My goal is to created a PDF form in LiveCycle Designer, put it on the website, send XFDF (or whatever) to the PDF on the client side to pre-populated it, then have the user submit the XML from the form back to the server. This is probably a typical scenario, but I'm a little confused on the formatting.<br /><br />Data exported from PDF to an EMAIL looks like this:<br /><br /> <?xml version="1.0" encoding="UTF-8" ?> <br />- <topmostSubform><br /> <txtReferralDate /> <br /> <chkInpatient>0</chkInpatient> <br /> <txtHospital /> <br /> <chkOutpatient>0</chkOutpatient> <br /> <txtPat_Name /> <br /> <txtPat_Addr1 /> <br /> <txtPat_Addr2 /> <br /> <txtPat_Phone /> <br /> <txtPat_OHIP /> <br /> </topmostSubform><br /><br />The XFDF Specification says it SHOULD be like this:<br /><br /><?xml version="1.0" encoding="UTF-8"?><br /><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><br /><field name="txtPat_Name"><br /><value>John</value><br /></field><br />(etc.)<br /><br />So my questions are:<br />1. Which format do I use when sending data to the client to load a pre-populated form?<br />2. When data is posted to a server in XML, how do I read and parse that data in C#? (or at least, how is the XML "posted"? Obviously not as an HTML form post.)<br />3. Am I even doing this correctly? Perhaps there is a better method?<br /><br />Thanks.
3 Replies

Avatar

Former Community Member
XFDF is related to the "old" AcroForms technology. LiveCycle Designer is not compatible with XFDF but works only with the newer XML Forms (sometimes referred to as XFA). XFA technology has it's own set of specs available from Adobe.



Regarding question 1, be aware that Reader (free) does not allow import of data into a form. Anyone using your form as you describe is going to need Acrobat (not free). [Or you need to pay a very large fee for "Reader Extensions"]. Anyway, the technique is to accomplish what you describe is to have the client request the "pre-population" data via a Web Service.



Answer to question 2: Acrobat can send data to your server via SOAP Web Services. Reader and Acrobat are both capable of sending form data via HTTP POST. The data is simply inside the body of the POST message.

Avatar

Former Community Member
I meant creating a file that, when sent to the client browser, loads a PDF pre-populated with the specified data like this "older" method:<br /><br /><?xml version="1.0" encoding="UTF-8"?><br /><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><br /><f href="test.pdf"/><br /><fields><br /><field name="txtName"><br /><value>Bob</value><br /></field><br /></fields><br /></xfdf><br /><br />So, you're saying that this is not possible, period, for the free reader plugin to open an online form pre-populated with data? If so, that is not very "public" friendly.

Avatar

Former Community Member
It sound like what you are trying to do is not possible with XFA forms and nothing else.



Forms can be pre-populated with data in two ways

1) XDP merged with an XML file by Forms Server

2) Through the use of web services, which requires Reader Extensions



Being in a .NET environment, Reader Extensions is the only option compatible with doing that.



Reader can do the what you need to, you just need Reader Extensions to allow that functionality