How Can I Programmatically populate Form Fields and print ?
I am not a new programmer but this has been a surpisingly difficult issue.
I hope that someone can help me to do what should be quite straight forward.
Can I be missing something ?
What i am trying to do is :
Develop a C# program which runs on a client computer to:
1. Read through a number of internal source files. (format variable)
2 - read an Adobe Acrobat 9.0 PDF form which is authored and supplied by a state or federal governmental agency.
3. locate uniquely named text fields in the PDF file specification or document tree that can be programmatically updated with the specific information needed for each field as records are processed.
4. Print out each form after it is updated.
It is my understanding that this might be able to be accomlished using
XFA and XDP but that there may be some unique processing requirements on my part .... requirements not clear ... this is anecdotal information as I have no written information except the XFA specification doc doesnt necessarily help me with accessing the PDF information directly until I read more
I am hoping that my requirement is clearly stated so that I can be told if I am close to the correct approach using Adobe SDk's or utilities - Since I do not know what is available
I am quite versed using XSD and XML and feel comfortable with the possibility that I might be able to do this... but i need to have a bit more information and i am hoping that this is the place to get it .
I use XSD to help automate application development and I can see where this would be useful for PDF forms but the information is very sprarse on usage issues.
This is as far as I have gotten and it has taken me far longer than I would have ever imagined to learn only this much information
I appreciate any assistance with this matter
I know what XML serialization does and how XSD is used in this process .... I gues what i cant seem to find out is how - I get a very large xml data file to be read appropriately by the PDF form.
I have an XML schema and I can edit the PDF to match the schema field names - but I don't know what to do next
If this were a C# program I could easily proceed using xsd commands to the pre-process to bind the xml field names to the classes in the appropriate namespace .
Would it be possible for me to create my own XML output - both schema and data to be used by a locally edited PDF file ????
basically - I am wondering if I can create my own schema and the associated xml data from the various and variable sources that are necessary to fill out the form. Then edit the PDF file locally with filed names to match the newly derived schema and then print the forms as required.
You can create your own schema and by importing it into the form design you can bind whatever fields you want to differnet nodes in the schema. Now when you export data the xml will follow the format of the schema. So this allows you to have a field on your form of a specific name but when exported it would be in a node in the xml with a completly different name.
basically - I am wondering if I can create my own schema and the associated xml data from the various and variable sources that are necessary to fill out the form. Then edit the PDF file locally with matching field names to match the newly derived XML schema and then print the forms as required.
The schema must be created ahead of time. You cannot create the schema on the fly. Once it is created you can bind individual nodes in the schema to fields on the form. Printing has nothing to do with this process ....and yes you can print at anytinme.
Thank you. I appreciate it .
I have access to a schema -
But all i have been able to do, (more or less), is - to create a PDF from the schema - the fields have the correct names. etc ... but
I am still not catching how to actually pre-populate the form itself - using the actual XML data that adheres to the schema.
I have tried several times - and proably will several more times to do this but it is not readily apparent or readly described in ANY of the adobe literature -
how to get it to autoread a long XML datafile which adheres to a schema.
so far, all I can get it that - it will create a form based on the schema - and where the XML data source data gets read is not being mentioned - so that I can understand it.
At this point, If I was able to get the PDF created from the schema to print one by one - with an operator required to click the button -
i would consider it a major achievement.
I hope that you are able to assist me in accomplishing this
afterwards I can research what it might take to do this programmatically
Ok Now I get it ...I assume that you have a sample data file that you want to bring in to the form. You can open the file in Acrobat/Reader and Under the Forms menu choose Manage Form Data/Import Data. You can pick the file and then the merge will happen.
You can also add a button to your form and in the click event you can add this code:
When the user hits the button a dialog will come up and allow the user to choose a file to import.
Note that in both cases the file must be XML and needs to follow the schema you mentioned.
If you want to serve up the form and have data in it you will need to do this from LiveCycle Forms on the server side.
OK - this is good -
Thank you ...
I am using a form prepared by a governmental agency
The schema is as well
but Live Cycle doesnt recognize it or something because the use XML Data Root Element name- is unusable .
nothing shows up in the dropdown and I cannot type in anything either -
SO i can't embed the schema or is this step even necessary to do what I want ?
I had supposed that I needed to embed the schema in the document - but i'll give it a try without trying that step