Permalink
Cannot retrieve contributors at this time
docassemble/docassemble_base/docassemble/base/data/questions/examples/pdf-template-alt-3.yml
Go to file
62 lines (61 sloc)
1.4 KB
metadata: | |
title: Fill fields with code | |
short title: Fill | |
documentation: "https://docassemble.org/docs/documents.html#template code" | |
example start: 7 | |
example end: 7 | |
--- | |
objects: | |
recipient: Individual | |
--- | |
question: | | |
Assembling a document from a PDF | |
template | |
subquestion: | | |
This interview will fill fields in | |
a PDF template. You can | |
[download the template] to see what | |
it looks like. | |
[download the template]: ${ url_of('letter.pdf') } | |
field: introduction_shown | |
--- | |
question: | | |
To whom shall the letter be sent? | |
fields: | |
- First Name: recipient.name.first | |
- Last Name: recipient.name.last | |
--- | |
question: | | |
What is the address of ${ recipient }? | |
fields: | |
- Address: recipient.address.address | |
- Unit: recipient.address.unit | |
required: False | |
- City: recipient.address.city | |
- State: recipient.address.state | |
code: | | |
states_list() | |
- Zip: recipient.address.zip | |
required: False | |
--- | |
question: | | |
What is the subject of the letter? | |
field: subject_of_letter | |
choices: | |
- Sales of oranges in Q4 2016 | |
- Pedantry and pedagogy | |
- Tulips, tiptoes, and soil erosion | |
- Breakfast cereals in late antiquity | |
--- | |
mandatory: true | |
code: | | |
introduction_shown | |
--- | |
mandatory: True | |
question: Here is your document. | |
attachment: | |
pdf template file: letter.pdf | |
code: | |
dict(letter_date=today(), | |
subject_line=subject_of_letter, | |
recipient_address=recipient.address_block()) |