Skip to content

smart documents

Write the document once. Every customer gets their own.

A Word-style editor that thinks like data. Drop variables in as chips, write IF and ELSE clauses, loop over a list, and paste from Word. Mezdoc lays out the pages, so a clause that appears or a schedule that grows never breaks the layout.

One template. Three different documents.

The same loan agreement, rendered for three borrowers. Nobody edited a page by hand.
  1. coverage
    40,000
    schedule
    3 items

    Coastline Bakery. Coverage is under the threshold, so the ELSE clause prints. Three rows, one page.

  2. coverage
    75,000
    schedule
    6 items

    Harbor Point LLC. Coverage is over 50,000, so rider clause B joins the agreement. Six rows.

  3. coverage
    120,000
    schedule
    18 items

    Northgate Freight. Eighteen rows run onto a second page, and the table header repeats there.

Loop over a list of anything.

A FOR EACH block renders one row per item, at section level or inside a table. Edit the data and watch the document follow.
Your data (the array)
0
1
2
Rendered document
FOR EACH item in line_items
render item.desc and item.amount
DescriptionAmount
Premium, year 112,000
Rider B premium1,800
Processing fee500
3 rows rendered. Send 1 or 100, the loop fits the data.

What the editor gives you.

For quote letters, policies, loan agreements and offer letters. Anything that changes shape with the data it carries.

See quote letters and schedules in the quote-to-binder document workflow
Variables
Type @ to insert a field as a chip. Text, numbers, dates, currency, images, signatures and lists are all variables.
Conditions
IF, ELSE IF and ELSE branches. Compare with equals, not equals, greater or less than, contains, starts with or ends with, and join rules with AND and OR.
Loops
FOR EACH repeats a section, or a table row, once per item in a list.
Word import
Import a .docx and its tables, fonts, sizes and page setup come across. You can also paste straight from Word.
Page setup
Letter, A4, Legal or A3, portrait or landscape, with your margins. Headers and footers on every page or the first only, page numbers, and table headers that repeat on each page.
Checks
The editor flags misconfigured fields before you publish, and the preview fills the document with sample data so you see the conditions and loops resolve.

Same API as a fillable PDF.

Send the data object and get the PDF back. Lists in the data drive the loops, and fields in the data decide the clauses.

Read the API docs
Render a smart document
curl -X POST https://api.mezdoc.com/api/v1/templates/loan_agreement/render \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "data": { "borrower": { "name": "Harbor Point LLC" },
                "coverage": 75000,
                "schedule": [ ... ] } }'
# 200 OK, application/pdf

Questions about smart documents.

Can I start from our existing Word documents?

Yes. Import a .docx and its tables, fonts, sizes and margins come across, ready for variables. You can also paste straight from Word.

What kinds of rules can a clause use?

Compare a field with equals, not equals, greater or less than, contains, starts with or ends with, and combine rules with AND and OR. An ELSE branch covers the other case.

Is a smart document different from a fillable PDF in the API?

No. Both are templates and both render through the same endpoint with the same data object, so your integration does not change with the template kind.

Write it once. Render it on every request.

Bring an existing Word document, mark what changes, and send your first PDF.

Free plan, no card