Print form instance
This API call is made to produce a PDF from a form instance. Often electronic forms can be used to make a paper process easier, faster, and to track the activity in electronic format. However, at the end of the day, a printed copy may still be required. The Print Form Instance API call combines the form instance XML and the form's XSL-FO stylesheets to create a PDF instance.
Example API call
/servlets3/wietmsd?id=1459517090403&book=s1000d_bike_41&collection=default&uniqid=1459517089222&target=forms&action=print_form&form_type=genforms&form_name=genform1&instance_name=genform1-1459517090403-1459517436914&instance_id=genform1-1459517090403-1459517436914
Parameters
| Parameter | Description |
|---|---|
target | forms |
action | print_form |
form_type | This value is always genforms. |
form_name | The system identifier of the form type, such as SavedSearches, genform1, or template. |
instance_name | Instance name, such as |
instance_id | Instance name, such as |
uniqid | To prevent browser-side caching of data, especially with AJAX requests, it is important to make a URL unique. The most effective technique to accomplish this is to include a time parameter that is based on the time at which the call is made. |
id | A session ID that is valid for this collection and publication combination. |
book | The name of the publication, such as s1000d_bike_41. |
collection | The name of the collection that the publication is registered in, such as default. |
XML post data
This API call requires XML post data to complete. An example of that XML data is given here. To print a form, the form should be saved first using the API. Once the for has been saved, this API call can be used to print the form. The form XML still needs to be provided to the print API call. The XML post data is wrapped in a <form-data/> element and contains a single <cond/> element for each piece of data the user wants to save for the form. Each <cond/> can have multiple children, if there are multiple values associated with a single form field or entry.
<form-data>
<cond label='First%20Name%20*' id='first_name'>
<item>PrintSatisfactionForm</item>
</cond>
<cond label='Middle%20Initial' id='middle_init'>
<item></item>
</cond>
<cond label='Last%20Name%20*' id='last_name'>
<item>PrintSatisfactionForm</item>
</cond>
<cond label='Satisfied%3F%20*' id='satisfied'>
<item label='Yes'>yes</item>
</cond>
<cond label='Your%20Comments' id='comments'>
<item>PrintSatisfactionForm</item>
</cond>
</form-data>
Returns
- On success
-
An HTML instance with the reference to the printed .pdf output that will immediately redirect to the PDF resource. The result of this API call is usually loaded into a new window to avoid losing the content of the calling window.
<result> <url>/servlets3/wietmsd/working/temp/genform1-1459517090403-1459517436914.pdf</url> </result> - On failure
- Returns nothing