PDF Data Record¶
A PDF can be generated containing the data in a submission. The style of the PDF can be controlled by using appearance settings in the survey or a PDF template can be used where the data from the survey is inserted into fields in the template.
Create and style the PDF template in a PDF editor then use Prepare Form to add the form fields that will be populate by data from the submitted record.
Specify PDF form fields as placeholders to be replaced by data from the survey. Each form field should be given the name of the question that contains the data to be inserted at that location.
- Use a text field for text, integer, barcode, select questions.
- Use an image field for location questions such as geopoint, geotrace, geoshape and start-geopoint
- Use an image field for image questions
- Set the name of the field to the name of the question
Where questions are inside a repeating group you need to identify which iteration of the repeat you want to show. The field name should be set to repeat_name[i].question_name where i is repeat record you want to show. For example:
members.name Will be filled with the name from the first entry in the members sub form.
- _hrk: The generated unique key for the record
- prikey: The primary key of the record
- user: The user who submitted the record
- _start: The start time of the survey
- _end: The end time of the survey
- _device: The device identifier that submitted the record
- instancename: The generated instance name
Style the PDF using appearance options set in the survey. The online editor offers good support for this. In the appearance editing dialog there is a tab for PDF settings. Alterntively you can set appearance values by referring to PDF Appearances
start-geopoint is a meta item that will automatically record the location of the first question asked in a survey. In a PDF this is shown on a map as a green pin containing the image of an anchor.
If there is another geometry in the same form then the start-geopoint will be shown on the same map as the other geometry. The following image shows this with the location of a geopoint shown using the (default) red pin near to the location recorded by start-geopoint in green.