My team has a template (XDP) that we’ve created with the Adobe LiveCycle designer.
The situation:
-
We are replacing an old Acrobat form
(XFDF format) with this LiveCycle
form as part of a much larger upgrade -
The current Acrobat form is
dynamically populated with basic data
and delivered to the user as a PDF
(the user clicks a link and a PDF
opens on their machine pre-populated
with basic demographic details) -
The current process looks something like: user clicks, .NET app retrieves data, .NET app retrieves PDF from file system, .NET app serializes data into template in XFDF form, ASP.NET app sends an HTTP response back to the user in XFDF format, the user views the PDF in Adobe Reader
We would like to maintain a roughly analogous process with the new XDP format.
For the record, we DO have access to the LiveCycle services that do this type of work (e.g. the Render service). That said, we would like to create this type of serialization in .NET for a few reasons: we have limited LiveCycle licenses and will struggle to access the LiveCycle services due to their location in the enterprise.
Any thoughts (even “stop doing that, you’re insane”) are appreciated.
Hey, sorry for the slow reply, didn’t see this.
Create the PDF. Encode it as base64.
Create a text file, foo.xdp:
Insert the XML here that is your dynamic data, matching the dynamic fields in the PDF.
Without putting any characters after the tag, insert the base64 encoded PDF.
And, lo and behold, you have a valid XDP. Adobe Reader will accept this and display the PDF with your values in it.
In Java, if you have a Properties with the connection details in it, the following code can use Livecycle to turn an XDP to a PDF, although your mileage might vary in C#.