📄 PDF generation in propform

propform can generate PDF documents after a form is submitted — e.g. anti-money laundering documentation, notary instructions, handover reports, booking confirmations — and save them in onOffice, attach them to an email, or do both.


Contents


Concept: PDF via onOffice templates

propform uses the onOffice PDF Designer for PDF creation. Upon submission, propform instructs onOffice to render the selected template and saves the result in the desired record.

> ⚠️ Important API limitation: Currently, only the PDFExposé API call is available; there is no PDFBrief. Money laundering documents, emergency orders, etc. are therefore also created as “Exposé” — but in terms of content, they are completely normal PDF documents. propform has been asking onOffice for a dedicated letter API call for years, but it has not yet been implemented.


Create a PDF template in onOffice

  1. In onOffice → EditPDF Designer
  2. Create new template → select “Create PDF Exposé” (even if it is not intended to be a property advertisement)
  3. Remove all standard pages
  4. New page → insert “Text page”
  5. Work in the text page editor in exactly the same way as in a PDF letter

Important: “Activate” the template

The template must be explicitly “activated” — otherwise the API user cannot read it:

  • PDF Designer → Open template → “Activate PDF Exposé” at the bottom
  • Select “For all” — otherwise the API user will not see the template

Tip: Use your own master template as a basis

You have to set the logo size, page margins and fonts individually in every new template — which is a hassle. Create a master template with your standard setup (logo at the top, margins, fonts), and copy it each time instead of creating a new one from scratch.


Table layout for fields

If the PDF outputs the form values as a list, it quickly looks messy as continuous text. Better: table layout.

Quick tip: Import fields from propform with a single click

When configuring the email in propform → click ‘Add form fields as macros’ under Body → propform writes all field macros in sequence into the email body.

Copy this block (Ctrl+C) and paste it into the PDF template. This way, you already have all the macros with the correct spelling — saving you the trouble of searching for them manually.

Table in the PDF template

  1. PDF Designer → Text page → Insert table with 2 columns
  2. Number of rows = number of fields you want to display
  3. Select a layout from the example picker (striped / with borders / lines only)
  4. Per row: on the left the label (“Contract Partner”), on the right the macro (_xVertragspartner)
  5. Use Ctrl+X / Ctrl+V to insert the macros from the previously copied block into the right-hand column

Result: a clean, readable PDF with two columns.


Create and save file

In Form settings → “Create and save file”, configure the following:

Setting What
PDF template select from the onOffice template dropdown
Storage location Address or property (or both)
Document type optional — e.g. “Money laundering document”, “Reservation”, “Handover report”
File name Plain text with macros, e.g. Geldwaesche_Doku_<_Vorname>_<_Name>
PDF protection optional, prevents subsequent editing

Automatically attach to email

In the email configuration → tick the box for “Attach files submitted via form”. Files that have been created also count as “submitted files” and are automatically included.

> 💡 Workflow: Submit → File is created in the background (1–3 seconds) → File is added to the record → Email is sent to the recipient with the file attached.

Dropdown not showing the template?

The fields/templates are updated daily in the morning. If you have just created a new template in onOffice:

  1. Open Form Overview in your propform account → triggers an update in the background
  2. Wait 10–20 seconds
  3. Press F5 in the form editor → the template should now appear in the dropdown menu

For more on this “refresh trick”, see Fields are not displayed.


## Pre-macros for PDF templates

In PDF templates generated via email, macro resolution takes place on the recipient’s end — not on the requester’s. This results in empty fields if the recipient is an internal colleague.

Solution: Pre-macros

| Pre-macro | Meaning || |---|---|| | _Kaeufer / _Buyer | accesses the buyer linked in the form | | _Eigent / _Owner | accesses the owner linked in the form | | _Mieter / _Renter | accesses the tenant linked in the form |

> ⚠️ Notation: The pre-macro and field name are written without an underscore in between — i.e. _KaeuferVorname, not _Kaeufer_Vorname.

Example in PDF:

Käufer: _KaeuferVorname _KaeuferName
Anschrift: _KaeuferStrasse, _KaeuferPlz _KaeuferOrt

Eigentümer: _EigentVorname _EigentName

This ensures the correct data is retrieved — regardless of the email recipient.

📖 More on address links: Linking multiple records and Values are not transferred to the PDF.


Embedding signatures & file path macros

If the PDF is to contain signatures, ID scans or other images from file fields, use the file path macros:

_dateipfadAdressfeld(unterschrift_kaeufer;400;variabel;mail;html)

Parameters (order is important, separated by semicolons):

  • Field name: internal onOffice file field name
  • Width: value in the selected unit (typically 400 for signatures, 600 for ID cards)
  • Height: fixed value or variabel (proportional)
  • Unit: px or mm
  • Type: mail or html

For property file fields: _dateipfadObjektfeld(...) with the same syntax.

Multi-Sig: multiple signatures per record

For notarial contracts or handover protocols with multiple buyers/owners: use the file path macro within the address loop — a separate file field for each buyer:

Vertragspartner:
_buyerbrek_1_
- _BuyerVorname _BuyerName
  Unterschrift: _ifEmpty(unterschrift_kaeufer;"";"_dateipfadAdressfeld(unterschrift_kaeufer;400;variabel;mail;html)")
_buyererek_1_

> 🔒 Always wrap _ifEmpty(...): If a buyer has not yet signed (file field empty), the macro would otherwise output a placeholder. With the _ifEmpty wrapper, the space simply remains empty — the PDF looks neat.

Tip: ID cards (front + back)

As a file field only stores one file, you need two separate file fields for the front and back of the ID card (e.g. ausweis_vorne and ausweis_hinten). Then embed both in the PDF one after the other — ideally using a table, each with a width of 600 px.


Common pitfalls

‘Create file’ button enabled, but no template selected

If the “Create and save file” button is on but no template is selected: nothing happens silently. No error message, no PDF.

Solution: Always select a template explicitly. If you don’t want a PDF temporarily, it’s better to switch the button off.

Incorrect macro naming convention (CamelCase vs. lowercase)

  • Address macros: CamelCase with capitalised first letter (_Name, _Vorname, _Strasse)
  • Property macros: all lowercase (_objektart, _ort, _plz)

Incorrect spelling → field remains empty in the PDF. More under Values are not transferred to the PDF.

Template folder record permissions

If the template does not appear in the dropdown in propform, check:

  1. Record permissions for the template itself
  2. Record permissions for the template folder ← often forgotten!
  3. API user permissions: “PDF templates → read → all”

More under My form is not writing any data Point 6.

PDF is not created after submission

  • API user has no write permissions for the module (address or property, depending on the storage location)
  • API user has no permissions to create documents
  • onOffice API is temporarily unavailable — if this happens repeatedly, please contact us

Related