Documentation Center

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&target=forms&action=print_form&form_type=genforms&form_name=genform1&instance_name=genform1-1459517090403-1459517436914&instance_id=genform1-1459517090403-1459517436914

Parameters

ParameterDescription
targetforms
actionprint_form
form_typeThis value is always genforms.
form_nameThe system identifier of the form type, such as SavedSearches, genform1, or template.
instance_name

Instance name, such as genform1-1459517090403-1459517436914.

instance_id

Instance name, such as genform1-1459517090403-1459517436914.

idA session ID that is valid for this collection and publication combination.
book The name of the publication, such as s1000d_bike_41.
collectionThe 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