# Welcome to docMaker

User guide

## Overview

Learn how you can automate your documents creation with docMaker.

## Get Started

We've put together some helpful guides for you to get setup with our product quickly and easily.

{% content-ref url="/pages/Dnscs8KyKKhTLBDDI4rB" %}
[Bubble.io](/integrations/bubble.io)
{% endcontent-ref %}

{% content-ref url="/pages/s6lbvbIwKgZIHrbQ2MIk" %}
[Easy pdf from docx template](/integrations/bubble.io/easy-pdf-from-docx-template)
{% endcontent-ref %}

{% content-ref url="/pages/XIaxSP2jdwlnng0ElqqH" %}
[Fill-out pdf forms](/integrations/bubble.io/fill-out-pdf-forms)
{% endcontent-ref %}


# Create pdf from docx template

The easiest way to generate beautiful pdfs

Create a docx template in MS Word, Libre Office or Google docs. Then use your favorite app to send data, and connect with docMaker to get fantastic pdf or docx documents!

:arrow\_forward:[ Go to the next chapter](/features/create-pdf-from-docx-template/build-your-docx-template/overview) to learn how to build your docx template.

Or click on the list below to discover our integrations for this feature:

* [Bubble.io plugin](/integrations/bubble.io/easy-pdf-from-docx-template)
* [Typeform integration](/integrations/typeform)
* [Zapier integration](/integrations/zapier)
* [API](https://elian-faggion.gitbook.io/moovsur)


# Build your docx template

In most document automation workflows, you will have to start with the creation of a docx template.&#x20;

You can also copy one of those offered in your docMaker dashboard (<https://app.docmaker.co/> dashboard).

Read the next chapters to discover the syntax to be used in your docx files to enable docMaker to replace tags with dynamic data!


# Overview

### How does it work? <a href="#how-does-it-work" id="how-does-it-work"></a>

docMaker finds all tags **`{}`** in your document (docx) and replaces these tags by data. According to the syntax of your tags, you can make a lot of operations including

* Replacing a field
* Formatting data
* Repeating a document portion (a table row or anything else)
* Looping on unlimited nested arrays
* Conditionally displaying a data based on a test expression

The syntax is **easy to learn**. It is like using a JSON Array or Object in Javascript.

Combined with features of LibreOffice™ or MS Office™, you can easily create documents with:

* Graphics
* Headers, footers
* Automatically repeated table header across pages
* Insert computed field
* Page count
* ...

### How to read this documentation <a href="#how-to-read-this-documentation" id="how-to-read-this-documentation"></a>

{% hint style="info" %}
If you are using our Zapier or Typeform integrations, **you do not have to care about the JSON data information in the following documentation**. Indeed, it will be handled behind the scenes by Zapier or Typeform.

You just have to create the docx template, and then map the dynamic data with the template, either in Zapier or in docMaker dashboard for Typeform.
{% endhint %}

Each part of this documentation shows exactly what happens if you send **Data** (JSON Object) and a **Template** (handmade docx, odt, ...) to docMaker.

> Please note that you may also start with one of our pre-built templates (see the ["Templates"](https://app.docmaker.co/dashboard?menu=templates) section in your docMaker dahsboard), and adjust it using the below guidelines.&#x20;

The first thing to do is to open your document editor (Libreoffice, Microsoft Word, Google docs etc.). Once you have done it, you will be able to start building your template.&#x20;

> Once you have built it, we recommend that you test your template in the [“Template check”](https://app.docmaker.co/dashboard?menu=templatev) section of your docMaker dashboar, to make sure that it is valid. This will also get you all the tags from your template in a JSON format which you may use to easily build your API call.&#x20;


# Text substitution

This is the most basic example. This is what your JSON data should contain :

**Data**

{% code lineNumbers="true" %}

```json
{
  "firstname": "John",
  "lastname": "Doe"
}
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="315.3333333333333"></th><th width="108" align="center"></th><th></th></tr></thead><tbody><tr><td><strong>Template</strong></td><td align="center"> </td><td><strong>Result</strong></td></tr><tr><td>Hello {firstname} {lastname} !          </td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="27a1">➡️</span></td><td>Hello John Doe!</td></tr></tbody></table>

&#x20;In your template, the tags between curly braces will be replaced by the data you provided


# Images

You can insert .png and .jpeg images into your document, and you can adjust images width :

* either glogally with the `“forceWidth”` parameter in the body of your JSON. Example :   `"forceWidth" : 200`, will apply a 200 pixels width to all the images in your document (height will adjust automatically)
* or individually for any individual image, by sending a `“.setImageWidth”` parameter in your data (see example below)

In order to insert an image into your document, you have to send the image URL in your data

You can also set the image width (in pixels) by adding a `.setImageWidth` parameter, as shown below:

**Data**

{% code lineNumbers="true" %}

```json
{
  "flower": "https://cdn.pixabay.com/photo/2019/12/15/11/22/flowers-4696878_960_720.jpg",
  "flower.setImageWidth": 200
}
```

{% endcode %}

In the template, an image tag is like a substitution tag, but with an additional “%” sign:

<table data-header-hidden><thead><tr><th></th><th width="178.33333333333331" align="center"></th><th></th></tr></thead><tbody><tr><td><strong>Template</strong></td><td align="center"> </td><td><strong>Result</strong></td></tr><tr><td>{%flower}                                           </td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="27a1">➡️</span></td><td><img src="/files/kSrCigPT0xgdL1LGZYmi" alt=""></td></tr></tbody></table>

&#x20;


# Conditions

Conditions enable you to control the display of parts of your template based on conditional data:

* either a boolean (true/ false)
* or the presence of the data itself

{% hint style="info" %}
We recommend that when using conditions, you should always use tags starting with if\_, like  {#if\_myTag} text to be dislayed if true {/if\_myTag}. This will enable docMaker to know that you are using this tag as a conditional tag.
{% endhint %}

A condition section begins with a pound and ends with a slash. That is {#if\_person} begins a "if\_person" section while {/if\_person} ends it.

> **Example :** if you use in your template : {#if\_myTag} conditional data {/if\_myTag} => if you send {"if\_myTag" = true} the data inside  the{#if\_myTag} section will be displayed.

You may also use inverted sections to display data when the condition is false :&#x20;

> **Example :**  in your template : {^if\_myTag} conditional data {/if\_myTag} => if you send {"if\_myTag" = false} the data inside  the {^if\_myTag} section will be displayed.

Check out the examples below.&#x20;

### Example 1: block not displayed <a href="#example-1-block-not-displayed" id="example-1-block-not-displayed"></a>

Data

{% code lineNumbers="true" %}

```json
{
  "if_display" : false,
  "firstname": "John",
  "lastname": "Doe"
}
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="280.3333333333333"></th><th align="center"></th><th></th></tr></thead><tbody><tr><td><strong>Template</strong></td><td align="center"> </td><td><strong>Result</strong></td></tr><tr><td><p>{#if_display}</p><p>Hello {firstname} !                       </p><p>{/if_display}          </p><p>Your last name is {lastname} !                            </p></td><td align="center"><p><span data-gb-custom-inline data-tag="emoji" data-code="27a1">➡️</span></p><p> </p></td><td>Your last name is Doe!                              </td></tr></tbody></table>

&#x20;

### Example 2: block displayed <a href="#example-2-block-displayed" id="example-2-block-displayed"></a>

**Data**

{% code lineNumbers="true" %}

```json
{
  "if_display" : true,
  "firstname": "John",
  "lastname": "Doe"
}
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="349.3333333333333"></th><th width="88" align="center"></th><th></th></tr></thead><tbody><tr><td><strong>Template</strong></td><td align="center"> </td><td><strong>Result</strong></td></tr><tr><td><p>{#if_display}</p><p>Hello {firstname} !                       </p><p>{/if_display}          </p><p>Your last name is {lastname} !                            </p></td><td align="center"><p><span data-gb-custom-inline data-tag="emoji" data-code="27a1">➡️</span></p><p> </p></td><td><p>Hello John!</p><p>Your last name is Doe!                              </p></td></tr></tbody></table>

&#x20;

### Example 3: block not displayed based on data itself <a href="#example-3-block-not-displayed-based-on-data-itself" id="example-3-block-not-displayed-based-on-data-itself"></a>

**Data**

{% code lineNumbers="true" %}

```json
{
  "firstname": null,
  "lastname": "Doe"
}
```

{% endcode %}

<table data-header-hidden><thead><tr><th></th><th width="130.33333333333331" align="center"></th><th></th></tr></thead><tbody><tr><td><strong>Template</strong></td><td align="center"> </td><td><strong>Result</strong></td></tr><tr><td><p>{#firstname}</p><p>Hello {firstname} !                       </p><p>{/firstname}          </p><p>Your last name is {lastname} !                            </p></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="27a1">➡️</span></td><td>Your last name is Doe!                              </td></tr></tbody></table>

### Example 4: inverted conditions <a href="#example-4-inverted-conditions" id="example-4-inverted-conditions"></a>

An inverted section begins with a caret (hat) and ends with a slash. That is {^person} begins a "person" inverted section while {/person} ends it.

**Data**

{% code lineNumbers="true" %}

```json
{
  "if_display" : false,
  "firstname": "John",
  "lastname": "Doe"
}
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="312.3333333333333"></th><th width="148" align="center"></th><th></th></tr></thead><tbody><tr><td><strong>Template</strong></td><td align="center"> </td><td>Result</td></tr><tr><td><p>{#if_display}</p><p>Hello {firstname} !                       </p><p>{/if_display}          </p><p>{^if_display}</p><p>Inverted hello {firstname} !                       </p><p>{/if_display}      </p><p>Your last name is {lastname} !                            </p></td><td align="center"><p><span data-gb-custom-inline data-tag="emoji" data-code="27a1">➡️</span></p><p> </p></td><td><p>Inverted hello John!</p><p>Your last name is Doe!                              </p></td></tr></tbody></table>

&#x20;


# Loops


# Simple list

The loop should have a a JSON array strcuture, i.e. : be embedded in `[ ]` and contain key/ value pairs inside `{ }` , as shown below :

<pre class="language-json" data-line-numbers><code class="lang-json"><strong>{
</strong><strong>"cars" : [
</strong>    {"brand" : "Renault"},
    {"brand" : "Tesla"  },
    {"brand" : "Toyota" }
  ]
}
</code></pre>

As the loop contains only one element, we can use a dot tag `{.}` to create a list.&#x20;

| **Template**                                                              |                                                                                        | Result                                                 |
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| <p>{#cars}</p><p>- {.}</p><p>{/cars}                                 </p> | <p><span data-gb-custom-inline data-tag="emoji" data-code="27a1">➡️</span></p><p> </p> | <ul><li>Renault</li><li>Tesla</li><li>Toyota</li></ul> |

&#x20;

If the data loop contained more than 1 item type, then we would have to specify which data we want to display, with this tag :`{brand}` :

| **Template**                                                                  |                                                                                        | Result                                                 |
| ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| <p>{#cars}</p><p>- {brand}</p><p>{/cars}                                 </p> | <p><span data-gb-custom-inline data-tag="emoji" data-code="27a1">➡️</span></p><p> </p> | <ul><li>Renault</li><li>Tesla</li><li>Toyota</li></ul> |


# List with multiple values

When sending multiple values in your JSON data, you simply have to add as many tags as required in your template :

{% code lineNumbers="true" %}

```json
{
"orderLines": [
 {
   "item_name": "trousers",
   "item_price": 100
 },
 {
   "item_name": "shirt",
   "item_price": 50
 }
]
}
```

{% endcode %}

Copy

&#x20;

| **Template**                                                                                                                  |                                                                                        | Result                                                                            |
| ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| <p>{#orderLines}</p><p>- Ref. : {item\_name}, price : {item\_price}€</p><p>{/orderLines}                                 </p> | <p><span data-gb-custom-inline data-tag="emoji" data-code="27a1">➡️</span></p><p> </p> | <ul><li>Ref. : trousers, price : 100€</li><li>Ref. : shirt, price : 50€</li></ul> |


# Adding rows into a table

docMaker can add rows to your document's tables. It will add as many rows as you provide data in the JSON.

{% hint style="info" %}
The beauty of it, is that page numbers will increment automatically, and page breaks will be perfectly fitted !&#x20;
{% endhint %}

Example data :

&#x20;

```plaintext
{"orderLines": [
 {
   "item_name": "Shirt",
   "item_price": 88,
   "item_quantity" : 2
 },
 {
   "item_name": "Shoes",
   "item_price": 123
   "item_quantity" : 1
 },
 {
   "item_name": "Dress",
   "item_price": 345,
   "item_quantity" : 4
 }
]
}
```

&#x20;

<table data-header-hidden><thead><tr><th></th><th width="78.33333333333331"></th><th></th></tr></thead><tbody><tr><td><strong>Template</strong></td><td> </td><td><strong>Result</strong></td></tr><tr><td><img src="/files/EmOzMagKB6lafbD98AG7" alt=""></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="27a1">➡️</span></p><p> </p></td><td><img src="/files/Jwu6GJcJzs9vpEP7MKKa" alt="" data-size="original"></td></tr></tbody></table>

&#x20;


# Loops in columns + lines (grids)

If you have a list of items which you want to display in multiple columns and multiple lines, you may use our columns features.

{% hint style="info" %}
The beauty of it, is that page numbers will increment automatically, and page breaks will be perfectly fitted !&#x20;
{% endhint %}

Example data :

&#x20;

```plaintext
{"images": [
 {
   "title": "Shirt",
   "image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTjHWwPvOYKj1hg5y1UdGQw1RbG9HpKwpOZmw&s",
   "description" : "red, long sleeves"
 },
 {
   "title": "Dress",
   "image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTjHWwPvOYKj1hg5y1UdGQw1RbG9HpKwpOZmw&s",
   "description" : "blue and green"
 },
 {
   "title": "trousers",
   "image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTjHWwPvOYKj1hg5y1UdGQw1RbG9HpKwpOZmw&s",
   "description" : "blue jeans"
 }
]
}
```

&#x20;In your template, you have to add Col1, Col2, Col3 to each one of your variables, as shown below:

| <p>{#images}{%imageCol1}</p><p>{titleCol1}</p><p>{descriptionCol1}</p> | <p>{%imageCol2}</p><p>{titleCol2}</p><p>{descriptionCol2}</p> | <p>{%imageCol3}</p><p>{titleCol3}</p><p>{descriptionCol3}{/images}</p> |
| ---------------------------------------------------------------------- | ------------------------------------------------------------- | ---------------------------------------------------------------------- |

\
And in addition to that you have to provide the number of columns in the plugin JSON data, like this:    "images.nbColumns" :3,\
Then just create your JSON loop as usual.\
You can see a demo on this page : <https://docxtopdfplugintest.bubbleapps.io/version-test/image_loop?debug_mode=true>\
Editor: <https://bubble.io/page?type=page&name=image_loop&id=docxtopdfplugintest&tab=tabs-2>

<table data-header-hidden><thead><tr><th></th><th width="78.33333333333331"></th><th></th></tr></thead><tbody><tr><td><strong>Template</strong></td><td> </td><td><strong>Result</strong></td></tr><tr><td></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="27a1">➡️</span></p><p> </p></td><td><img src="/files/Jwu6GJcJzs9vpEP7MKKa" alt="" data-size="original"></td></tr></tbody></table>

&#x20;


# Nested loops

docMaker lets you create nested loops, without any limit in terms of depth of the loops.

The nested loops feature is very useful when  you need to group your output by categories. They can be used inside tables or also for plain text, in order to repeat multiples lines inside main paragraphs.

Below is an example of this feature in a template.

The Bubble demo can be found here : [demo](https://docxtopdfplugintest.bubbleapps.io/version-test/nested_loops?debug_mode=true) | [editor](https://bubble.io/page?type=page\&name=nested_loops\&id=docxtopdfplugintest\&tab=tabs-1)

In order to do that, you will have to create a nested loops JSON and nested loops in your template.

```plaintext
{“orders” : [
 {
   "name": "Order1",
   "orderLines": [
     {
       "item_name": "trousers",
       "item_quantity": 1,
       "item_price": 100,
     },
     {
       "item_name": "shirt",
       "item_quantity": 50,
       "item_price": 50,
     },
     {
       "item_name": "shoes",
       "item_quantity": 1,
       "item_price": 1,
     },
   ]
 },
 {
   "name": "Order2",
   "orderLines": [
     {
       "item_name": "socks",
       "item_quantity": 1,
       "item_price": 33,
     }
   ]
 }
]
}
```

Copy

&#x20;

<table data-header-hidden><thead><tr><th></th><th width="44.333333333333314"></th><th></th></tr></thead><tbody><tr><td><strong>Template</strong></td><td> </td><td>Result</td></tr><tr><td><img src="/files/JJlKJg59rJj7VEf5Sx0F" alt="">       </td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="27a1">➡️</span></p><p> </p></td><td><img src="/files/TloTunNzD26NUuovBdrG" alt="" data-size="original"></td></tr></tbody></table>

&#x20;


# QR codes

### How to transform any text/ URL into QR code image with docMaker <a href="#how-to-transform-any-text-url-into-qr-code-image-with-docmaker" id="how-to-transform-any-text-url-into-qr-code-image-with-docmaker"></a>

With docMaker you can convert any text string or webpage URL into a QR code.

In order to do that, you simply need to add “.toQRCode” to your dynamic data, like this:

&#x20;

```plaintext
{ “myURL.toQRCode” : “https://espn.com”  }
```

Copy

&#x20;

The trick for the QR codes feature is that in your template you have to use an image tag (starting with %)  like this :

&#x20;

| **Template**                                                                                                    |                                                                                        | Result                                                              |
| --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| <p>{%myURL}                                                           </p><p>                              </p> | <p><span data-gb-custom-inline data-tag="emoji" data-code="27a1">➡️</span></p><p> </p> | <img src="/files/cDh9IMBqNaltXVNErWim" alt="" data-size="original"> |

&#x20;


# Rich text & html

### Insert rich text in html format into your template

Ideal for user-generated content: enables you to add style and formatting to create your pdf.&#x20;

Your docx should contain the text: `{~html}`.&#x20;

* Any tag starting with `~` is used for inline HTML, such as : `{~html}` or {\~inlineComment} which will use the "inlineComment" data
* Any tag starting with `~~` is used for block HTML, such as : `{~~html}` or {\~\~styledTable} which will use the "styledTable" data

To be clear :

* The `{~inline}` tag is used when you want to replace part of a paragraph. For example you can write :

```txt
My product is {~blueText} and costs ...
```

The tag is inline, there is other text in the paragraph. In this case, you can only use inline HTML elements (`<span>` , `<b>` , `<i>`, `<u>`\\, …)

* The `{~~block}` tag is used when you want to replace a whole paragraph, and you want to insert multiple elements

```txt
{~~block}
```

The tag is block, there is no other text in the paragraph. In this case, you can only use block HTML elements (`<p>`, `<ul>`, `<table>`, `<ol>`, `<h1>`)

###

<details>

<summary>List of accepted html tags :</summary>

docMaker currently supports:

* `<br>`
* `<p>`
* `<h1-h6>` tags
* `<p>`
* `<b>`
* `<i>`
* `<u>`
* `<ul>`, `<ol>` and `<li>` for ordered and unordered lists
* `<span>`
* `<small>`
* `<s>`
* `<ins>` and `<del>`
* `<strong>`
* `<em>`
* `<code>`
* `<table>`, `<tr>`, `<td>`, `<tbody>`, `<thead>`, `<tfoot>`, `<th>` tags
* `<a href="URL">Linktext</a>`
* `<input type="checkbox">` and `<input type="checkbox" checked>`
* `<sub>` and `<sup>`
* `<pre>`, by using Courrier font and retaining all spaces
* `style="color: #bbbbbb"` property
* `style="font-size: 30px"` property
* `style="font-family: 'Times New Roman'"` property
* `style="background-color: blue"` property (or with rgb codes)
* `style="text-decoration: underline"` property
* `style="padding-left: 30px"`
* `style="width:33%; height: 50%;"` (on td only)
* `style="text-align:justify"` (or other values)
* `style="vertical-align: bottom"` (on td)
* `style="border: none"` (on table)
* `style="break-after:page"`
* `style="break-before:page"`
* `style="white-space:pre"`

</details>


# docx\_fill\_convert API parameters

Use all of our below options to personalize your pdf creation.

**API documentation:** <https://docmaker.co/api>

**Endpoint URL:** <https://api.v2.docmaker.co/docx\\_fill\\_convert>

### List of API call parameters:

<table><thead><tr><th width="214">Parameter</th><th width="137">Values enum</th><th>Decription</th></tr></thead><tbody><tr><td><code>"templateID"</code></td><td></td><td>ID of the docx template uploaded in your docmaker.co dashboard.</td></tr><tr><td><code>"templateURL"</code></td><td></td><td>As an alternative to the templateID, you may provide the full URL of your docx template file. Has to be a public file.</td></tr><tr><td><code>"name"</code></td><td></td><td>Name of the result file, has to include the extension (.pdf or .docx)</td></tr><tr><td><code>"pdfEngine"</code></td><td><code>"custom"</code>, <code>"standard"</code></td><td>"custom" pdf engine is faster but restricted to open source fonts (mostly google fonts)<br>"standard" pdf engine accepts most standard fonts</td></tr><tr><td>"<code>outputType"</code></td><td><code>"pdf"</code>, <code>"docx"</code></td><td>Define the format of the result file: docMaker can generate either docx or pdf files</td></tr><tr><td><code>"emptyTags"</code></td><td><p><code>"removeTags"</code>,</p><p><code>"leaveTags"</code>,</p><p><code>"undefined"</code>,</p><p><code>"N/A"</code></p></td><td>"removeTags": if no data is sent to replace a specific substitution tag, then the tag will be removed<br>"leaveTags": if no data, tag will remain in the document. Useful when creating custom templates with your app.<br>"undefined": if no data, tags will be replaced by "undefined"<br>"N/A": if no data, tags will be replaced by "N/A"</td></tr><tr><td><code>"showJSONinLogs"</code></td><td><p><code>true</code>,</p><p><code>false</code></p></td><td>Boolean parameter, if set to "no", then none of your data will be stored in docMaker servers, not event in technical logs</td></tr><tr><td><code>"metadata"</code></td><td></td><td>Free text field, where you can store any useful data to identify a specific docMaker API call in the logs</td></tr><tr><td><code>"upload_output_file"</code></td><td><code>true</code>,<code>false</code></td><td>Boolean parameter, defining whether result files should be uploaded to docMaker S3 buckets (files are deleted after 48 hours). Should be set to "yes" for most API calls. Except for Bubble.io, for which this can be set to "yes" if you chose to upload the result file to Bubble (see Bubble plugins specific parameters).</td></tr><tr><td><code>"privateUpload"</code></td><td><code>true</code>,<code>false</code></td><td>Boolean parameter, if set to "yes", your result files will be uploaded to a private S3 bucket. You will get a presigend URL valid for 2 hours.</td></tr><tr><td><code>"webhook_url"</code></td><td></td><td>URL of the webhook where you want the result file to be sent.</td></tr><tr><td><code>"webhook_token"</code></td><td></td><td>You may provide an auth token in order to authenticate the webhook call to your server. docMaker will add it as a Beare token in the "Authorization" header of the webhook API call.</td></tr><tr><td><code>"webhook_object_id"</code></td><td></td><td>Free text field, which you can use to help your backend identifiy the object to which the docMaker result_file should be attached.</td></tr><tr><td><code>"webhook_object_type"</code></td><td></td><td>Free text field, which you can use to help your backend identifiy the table to which the docMaker result_file should be attached.</td></tr><tr><td><code>"mailTo"</code></td><td></td><td>List of email adresses (separated by comma) to receove the email</td></tr><tr><td><code>"senderName"</code></td><td></td><td>Sender's name, when using docMaker to send the created file in attachment to an email.</td></tr><tr><td><code>"replyTo"</code></td><td></td><td>reply to: email adress to be used when your users will reply to the message set by docMaker</td></tr><tr><td><code>"ccTo"</code></td><td></td><td>cc to: List of email adresses (separated by comma) to receive a copy of the email sent by docMaker</td></tr><tr><td><code>"bccTo"</code></td><td></td><td>bcc to: List of email adresses (separated by comma)  to receive a blind copy of the email sent by docMaker</td></tr><tr><td><code>"mailSubject"</code></td><td></td><td>subject of the email</td></tr><tr><td><code>"mailContent"</code></td><td></td><td>email contents (html or text)</td></tr><tr><td><code>"attachOutput"</code></td><td><code>true</code>, <code>false</code></td><td>If true, the generated pdf will be attached ot the email</td></tr></tbody></table>


# Fill-out pdf forms

Automate cumbersome tasks like filling out official and custom pdf forms.&#x20;

Start with a fillable pdf form, then send data from your favorite software.

Available through API in all of our integrations!​

Click the "Next" button below to learn how to build your pdf form.


# Build your pdf form

In order to build your pdf form, or add editable fields into an existing pdf file, you may either:

* use the official Adobe pdf editing software like Acrobat DC ([official website](https://www.adobe.com/acrobat.html))
* use alternative pdf editing solutions like Sejda form builder ([website](https://www.sejda.com/pdf-forms)) or pdf filler ([website](https://www.pdffiller.com/en/functionality/create-fillable-pdf-forms-to-online-fillable-forms-online.htm))
* use free demo websites like [this one](https://developer.mescius.com/document-solutions/javascript-pdf-viewer/demos/sample/edit-pdf/purejs/)

docMaker accepts the following  field types:

* simple input text fields
* multiline input text fields
* radio buttons
* checkboxes
* buttons (to be used if you want to insert images or signatures in your document)
* options lists
* dropdown inputs


# pdf\_fill API parameters

Use all of our below options to personalize your pdf creation

**API documentation:** <https://docmaker.co/API>

**Endpoint URL:** <https://api.v2.docmaker.co/pdf\\_fill>

### List of API call parameters:

<table><thead><tr><th width="214">Parameter</th><th width="137">Values enum</th><th>Decription</th></tr></thead><tbody><tr><td><code>"templateID"</code></td><td></td><td>ID of the docx template uploaded in your docmaker.co dashboard.</td></tr><tr><td><code>"templateURL"</code></td><td></td><td>As an alternative to the templateID, you may provide the full URL of your docx template file. Has to be a public file.</td></tr><tr><td><code>"name"</code></td><td></td><td>Name of the result file, has to include the extension (.pdf)</td></tr><tr><td><code>"fontSize"</code></td><td></td><td>Font size to be used to fill your pdf document</td></tr><tr><td>"<code>readOnly"</code></td><td><code>true, false</code></td><td>Define whether the result file should remain editable (set to false) or if you want to create a non-editable file (set to true) .</td></tr><tr><td><code>"minFontSize"</code></td><td></td><td>In the case of multiline input, docMaker will automatically adjust the font size in order to make sure that the text data fits the box size. With the minFontSize parameter, you can define what is the minimum font size you want to accept for these fields. </td></tr><tr><td><code>"metadata"</code></td><td></td><td>Free text field, where you can store any useful data to identify a specific docMaker API call in the logs</td></tr><tr><td><code>"upload_output_file"</code></td><td><code>true</code>,<code>false</code></td><td>Boolean parameter, defining whether result files should be uploaded to docMaker S3 buckets (files are deleted after 48 hours). Should be set to true for most API calls. Except for Bubble.io, for which this can be set to false if you chose to upload the result file to Bubble (see Bubble plugins specific parameters).</td></tr><tr><td><code>"privateUpload"</code></td><td><code>true</code>,<code>false</code></td><td>Boolean parameter, if set to true, your result files will be uploaded to a private S3 bucket. You will get a presigend URL valid for 2 hours.</td></tr><tr><td><code>"webhook_url"</code></td><td></td><td>URL of the webhook where you want the result file to be sent.</td></tr><tr><td><code>"webhook_token"</code></td><td></td><td>You may provide an auth token in order to authenticate the webhook call to your server. docMaker will add it as a Beare token in the "Authorization" header of the webhook API call.</td></tr><tr><td><code>"webhook_object_id"</code></td><td></td><td>Free text field, which you can use to help your backend identifiy the object to which the docMaker result_file should be attached.</td></tr><tr><td><code>"webhook_object_type"</code></td><td></td><td>Free text field, which you can use to help your backend identifiy the table to which the docMaker result_file should be attached.</td></tr><tr><td><code>"mailTo"</code></td><td></td><td>List of email adresses (separated by comma) to receove the email</td></tr><tr><td><code>"senderName"</code></td><td></td><td>Sender's name, when using docMaker to send the created file in attachment to an email.</td></tr><tr><td><code>"replyTo"</code></td><td></td><td>reply to: email adress to be used when your users will reply to the message set by docMaker</td></tr><tr><td><code>"ccTo"</code></td><td></td><td>cc to: List of email adresses (separated by comma) to receive a copy of the email sent by docMaker</td></tr><tr><td><code>"bccTo"</code></td><td></td><td>bcc to: List of email adresses (separated by comma)  to receive a blind copy of the email sent by docMaker</td></tr><tr><td><code>"mailSubject"</code></td><td></td><td>subject of the email</td></tr><tr><td><code>"mailContent"</code></td><td></td><td>email contents (html or text)</td></tr><tr><td><code>"attachOutput"</code></td><td><code>true</code>, <code>false</code></td><td>If true, the generated pdf will be attached ot the email</td></tr><tr><td><code>"data"</code></td><td></td><td>This field will contain all of the dynamic data to fill-out the pdf form.</td></tr></tbody></table>


# Print web page to pdf


# page\_pdf API parameters

Use all of our below options to personalize your pdf creation

**API documentation:** <https://docmaker.co/API>

**Endpoint URL:** <https://api.v2.docmaker.co/page\\_pdf>

### List of API call parameters:

<table><thead><tr><th width="214">Parameter</th><th width="137">Values enum</th><th>Decription</th></tr></thead><tbody><tr><td><code>"url"</code></td><td></td><td>Required. URL of the webpage which you would like to print to pdf.</td></tr><tr><td><code>"name"</code></td><td></td><td>Name of the result file, has to include the extension (.pdf or .docx)</td></tr><tr><td><code>"pageSize"</code></td><td>"<code>letter", "legal", "tabloid", "a3", "a4", "a5", "full_length"</code></td><td>Required. Size of the pdf file which you would like to print. If you chose 'full_length' the whole webpage will be printed into 1 long pdf without page breaks.</td></tr><tr><td>"loadTime<code>"</code></td><td></td><td>Optional. Minimum loading time which you want to set for your page before triggering the export to pdf. Useful for pages with long loading time.</td></tr><tr><td><code>"pageRanges"</code></td><td></td><td>Optional. Page ranges to print to pdf. Examples : 1 or 2-4 or 3-7, 8-9. Leave empty if you want to print the whole document.</td></tr><tr><td><code>"landscape"</code></td><td><p><code>true</code>,</p><p><code>false</code></p></td><td>Required. Define your page orientation: true for landscape, false for portrait.</td></tr><tr><td><code>"metadata"</code></td><td></td><td>Free text field, where you can store any useful data to identify a specific docMaker API call in the logs</td></tr><tr><td><code>"upload_output_file"</code></td><td><code>true</code>,<code>false</code></td><td>Boolean parameter, defining whether result files should be uploaded to docMaker S3 buckets (files are deleted after 48 hours). Should be set to "yes" for most API calls. Except for Bubble.io, for which this can be set to "yes" if you chose to upload the result file to Bubble (see Bubble plugins specific parameters).</td></tr><tr><td><code>"privateUpload"</code></td><td><code>true</code>,<code>false</code></td><td>Boolean parameter, if set to "yes", your result files will be uploaded to a private S3 bucket. You will get a presigend URL valid for 2 hours.</td></tr><tr><td><code>"getBase64"</code></td><td></td><td>Optional. If "true", your output file will be sent in base64 format in the JSON response.</td></tr><tr><td><code>"marginLeft"</code></td><td></td><td>Optional. Size of the left margin in pixels or in centimeters.</td></tr><tr><td><code>"marginRight"</code></td><td></td><td>Optional. Size of the right margin in pixels or in centimeters.</td></tr><tr><td><code>"marginTop"</code></td><td></td><td>Optional. Size of the top margin in pixels or in centimeters.</td></tr><tr><td><code>"marginBottom"</code></td><td></td><td>Optional. Size of the bottom margin in pixels or in centimeters.</td></tr><tr><td><code>"timeZone"</code></td><td></td><td>Optional. Timezone to be used by docMaker server when accessing your webpage for printing. See ICU meta zones <a href="http://example.com">Capo mastro (https://source.chromium.org/chromium/chromium/deps/icu.git/+/faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txt)</a></td></tr><tr><td><code>"language"</code></td><td></td><td>Optional. Browser language (locale) to be used by docMaker server when accessing your webpage for printing, according to ISO 3166-1 standard. List here: https://lingohub.com/developers/supported-locales/language-designators-with-regions</td></tr><tr><td><code>"vWidth"</code></td><td></td><td>Optional. Viewport width: width of the viewport to be used by docMaker when loading your page before exporting to pdf. Unit: pixels.</td></tr><tr><td><code>"vHeight"</code></td><td></td><td>Optional. Viewport height: height of the viewport to be used by docMaker when loading your page before exporting to pdf. Unit: pixels. Recommended height for full page printing : 600px</td></tr><tr><td><code>"showFooter"</code></td><td><p></p><p><code>"noFooter", "pageNumbers",</code></p><p><code>"customFooter"</code></p></td><td>Optional. Chose wether you want to displaya footer on each pdf page.</td></tr><tr><td><code>"htmlFooter"</code></td><td></td><td>Optional. If you have selected "customFooter" above, provide here Html footer code to be displayed on each page printed to pdf. Must include div position.</td></tr><tr><td><code>"webhook_url"</code></td><td></td><td>URL of the webhook where you want the result file to be sent.</td></tr><tr><td><code>"webhook_token"</code></td><td></td><td>You may provide an auth token in order to authenticate the webhook call to your server. docMaker will add it as a Bearer token in the "Authorization" header of the webhook API call.</td></tr><tr><td><code>"webhook_object_id"</code></td><td></td><td>Free text field, which you can use to help your backend identifiy the object to which the docMaker result_file should be attached.</td></tr><tr><td><code>"webhook_object_type"</code></td><td></td><td>Free text field, which you can use to help your backend identifiy the table to which the docMaker result_file should be attached.</td></tr></tbody></table>


# Typeform


# Create pdf or docx for each Typeform response

This article will show you how to create super easily pdf or docx files based on the responses to your Typeform questionnaires with docMaker.

**In this article you’ll learn how to:**

1. Create a new workflow
2. Customise a docx template with the form answers as variables&#x20;
3. Turn on the workflow

## 1. Create a new workflow and select Typeform source

First, once you've created your account on docMaker, go into the dashboard and go ahead to the workflows section, then add a new workflow with a Typeform source.

<figure><img src="/files/tu2gwUuEuhuswwWk1mGh" alt=""><figcaption></figcaption></figure>

This will add a first step to your workflow.

In this step you have to connect your Typeform account: click on the "connect Typeform" button, and provide the required information.

Now you can choose the form that you're going to use for this workflow.

<figure><img src="/files/j6vYGTZkJnr4bhfJ8gT2" alt=""><figcaption></figcaption></figure>

### 2. Customise a docx template with the form answers as variables&#x20;

When the form is connected to the workflow, go back to your workflow and add a new step, and in this step add a template. The template must be a Docx file:

\- you can either upload your template to your Google Drive and then paste the Google Drive link into docMaker (easier for online edit of the template). Make sure that your file is shared with "anyone with the link", with editor rights

\- or you can directly upload the Docx file to docMaker.

<figure><img src="/files/h3nuZScNBWvb9p10o6To" alt=""><figcaption></figcaption></figure>

You can noiw enter a template name. docMaker is going to give a template ID to make sure that there are no duplicates in IDs.

Paste your file URL and click on save. You can see that the template has been added and a new step was added in your workflow.&#x20;

<figure><img src="/files/rM13etVcIWk8wXJpyAdD" alt=""><figcaption></figcaption></figure>

Click on this new step and you can see that on the right hand side you can get all of the questions from your Typeform and the list of variables (or tags) corresponding to each question.&#x20;

<figure><img src="/files/Bnw88QV4DGVjSbaN4ZYF" alt=""><figcaption></figcaption></figure>

The tags represent the place where the response to this question is going to be used in the in the template.&#x20;

You can choose in which format to insert each tag into the document.

When clicking on the "copy" button, docMaker adds curly braces, that's how we represent the variables in the document.

<figure><img src="/files/mfo3bufsykBMARFhrizW" alt=""><figcaption></figcaption></figure>

It's very important that you choose the format before clicking on copy because the tag will be different, as you can see with the list tag below, which consists of 3 parts :&#x20;

* the opening tag&#x20;
* the list itself
* the closing tag

<figure><img src="/files/npiknh5apjiq11z0vQop" alt=""><figcaption></figcaption></figure>

You can use a condition type of tag. And you will see that conditions are also loops. Everything between those two tags will be visible if the client answers yes and not visible if the client answers no.&#x20;

<figure><img src="/files/MvxeLCPwYn39pstkOfNo" alt=""><figcaption></figcaption></figure>

You can give a name to your output file using the variables on the right hand side.

&#x20;Of course, only text, numbers and date types of variables can be used for the title

. The result file can be a PDF file or a docx file. (toggle button)

<figure><img src="/files/5tvLtZ2kakpIi6W5xDZ3" alt=""><figcaption></figcaption></figure>

#### 3. Turn on the workflow

Eventually, you have to publish your changes, by pressing the "Publish" buttton in the top right corner.

<figure><img src="/files/a8IDuAiD039XByJRPJE7" alt=""><figcaption></figcaption></figure>

Every time you change things in your workflow, you have to publish the changes to make sure that docMaker is up to date with all the latest settings that you have created.&#x20;

Now you are all set! :tada:

Every time this form will be submitted, a pdf will automatically be generated.

Move to the result section and hit "Refresh" to see the results of your workflow.

<figure><img src="/files/5dcMhbIcAR434OYEobjc" alt=""><figcaption></figcaption></figure>

If you click on any line, you will see the details of the request which was received by docMkaker from Typeform.&#x20;

<figure><img src="/files/eMCLy4tKOoA4Z30CZ97s" alt=""><figcaption></figcaption></figure>

So this way you can see exactly what your users have answered in the form.&#x20;

You can also open each result file individually, or zip and download all of them by clicking the download button.

<figure><img src="/files/rIDvhcnV5aZik1cuM6Z1" alt=""><figcaption></figcaption></figure>

Next, in your workflow you can use the result files in additional steps:

1. &#x20;to send it to a Webhook URL
2. to send it as attachment in an email

We hope you will enjoy using docMaker together with Typeform!

We are always available to help you: <support@docmaker.co>.


# Bubble.io

Thanks to our Bubble expertise, we have created the perfect experience for Bubble developers

We offer 3 plugins to help you get the most of your docMaker subscription:

<details>

<summary><a href="#easy-pdf-from-docx-templates">Easy pdf from docx templates</a></summary>

</details>

<details>

<summary><a href="#fill-out-pdf-forms">Fill-out pdf forms</a></summary>

</details>

<details>

<summary><a href="#webpage-to-pdf">Webpage to pdf</a></summary>

</details>


# Easy pdf from docx template

The easiest solution to create pdfs in Bubble.io

{% hint style="info" %}
**Useful links :**&#x20;

* [Bubble plugin page](https://bubble.io/plugin/docmaker---easy-pdf-creator-1678738839292x889230646623338500)&#x20;
* [Bubble forum page](https://forum.bubble.io/t/new-plugin-easy-pdf-creator/264447)&#x20;
* [Demo app (run mode)](https://docmaker-plugins.bubbleapps.io/version-test/demo_docx_simple?debug_mode=true\&tab=Create%20pdf%20from%20docx%20template\&sub=Simple%20demo)
* [Demo app (editor)](https://bubble.io/page?type=page\&name=demo_docx_simple\&id=docmaker-plugins\&tab=tabs-1)

&#x20;
{% endhint %}

## Tutorials

Have a look at our tutorial videos to learn how to use all of docMaker's  great features.

<table><thead><tr><th width="329">Title</th><th>Video</th></tr></thead><tbody><tr><td>Create pdfs from docx templates</td><td><a href="https://www.youtube.com/watch?v=2mJf90R79Qw&#x26;pp=ygUIZG9jbWFrZXI%3D">https://www.youtube.com/watch?v=2mJf90R79Qw&#x26;pp=ygUIZG9jbWFrZXI%3D</a></td></tr><tr><td>Create loops to add rows in table or add pages </td><td>To be published on june 30th</td></tr><tr><td>Lists and conditions</td><td>Coming soon</td></tr><tr><td>Add hyperlinks and html formated text to your documents</td><td>Coming soon</td></tr><tr><td></td><td></td></tr></tbody></table>


# Fill-out pdf forms

<details>

<summary>As a Guest User</summary>

</details>

<details>

<summary>As an Editor</summary>

</details>

<details>

<summary>As an Admin</summary>

</details>


# Webpage to pdf


# Make.com

Create pdf documents in your Make scenarios

<figure><img src="/files/mS6R9Ltb42BGbaCzkNs0" alt="" width="370"><figcaption></figcaption></figure>

Click on the following link to access our Make modules:

{% embed url="<https://eu1.make.com/app/invite/f97081e63582f0d7feb1d101190a214d>" %}

Modules currently available:

* Create pdf from docx template with immediate response
* Create pdf from webpage URL with immediate response (i.e. polling logic included)
* Create pdf from webpage URL with webhook&#x20;


# Coda

Create pdf documents in Coda

<figure><img src="/files/4tw4EUTNcYC5okpdNu7L" alt="" width="75"><figcaption></figcaption></figure>

Chek-out our Coda pack and set-up your pdf documents printing within minutes

{% embed url="<https://coda.io/packs/docmaker-pdf-generation-28076>" %}

This pack includes 2 actions:

{% tabs %}
{% tab title="Create pdf from docx template " %}
With this action you can use the data from your Coda databases to generate docx or pdf documents automatically.

Instructions:

* how to create your docx template: [Build your docx template](/features/create-pdf-from-docx-template/build-your-docx-template)
* parameters for documents creation: [docx\_fill\_convert API parameters](/features/create-pdf-from-docx-template/docx_fill_convert-api-parameters)
* The pack also includes a formula which lets you create JSON-formatted line items, to be used when data loops are used (to add rows to a table or add pages to your document)&#x20;

Full tutorial coming soon!&#x20;
{% endtab %}

{% tab title="Fill out pdf form" %}
With this action you can use the data from your Coda databases to fill-out pdf forms automatically.

Insctructions:

* how to create your pdf form: [Build your pdf form](/features/fill-out-pdf-forms/build-your-pdf-form)
* parameters: [pdf\_fill API parameters](/features/fill-out-pdf-forms/pdf_fill-api-parameters)

Full tutorial coming soon!&#x20;
{% endtab %}
{% endtabs %}


# Xano

Create pdf documents in Xano

<figure><img src="/files/kmW7Xz0QGeiljVHigep2" alt="" width="250"><figcaption></figcaption></figure>

Copy our snippet to easily add pdf creation features to your Xano apps:

{% embed url="<https://www.xano.com/snippet/XtgmXy3I/>" %}
docMaker official Xano snippet
{% endembed %}

The snippet contains the following API templates:

* Create pdf from docx template with immediate response (i.e. polling logic included)
* Create pdf from docx template with webhook (webhook example provided)
* &#x20;Create pdf from webpage URL with immediate response (i.e. polling logic included)
* Create pdf from webpage URL with webhook (webhook example provided)
* Fill-out pdf form with immediate response (i.e. polling logic included)
* Fill-out pdf form with webhook (webhook example provided)
* Webhook example


# Zapier


# API

## Create a new user

<mark style="color:green;">`POST`</mark> `/users`

\<Description of the endpoint>

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

| Name   | Type   | Description      |
| ------ | ------ | ---------------- |
| `name` | string | Name of the user |
| `age`  | number | Age of the user  |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "id": 1,
  "name": "John",
  "age": 30
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}


# Bubble.io questions

Bubble FAQ

<details>

<summary>How do I properly handle docMaker errors in Bubble?</summary>

In order to handle errors in your workflows:

\- if you are using a button to trigger docMaker actions, you will have to set-up a specific workflow to catch errors on this button's workflow, using the custom event : "An element has an error running a workflow" for this button. Then display to your user the Currrent workflow error's message, and also add it to your logs table (if you have one in your app) for future reference.

\- in addition to that, if you use a webhook :  when initializing the webhook you will see that there are a status code and a message in the JSON received from docMaker. Example of successful message to webhook :

```
{
  "success": true,
  "statusCode": 200,
  "message": "file created successfully",
  "result_file": "//3611f468aafc8649dcc4ec273e00346a.cdn.bubble.io/f1693992574960x341126990077366140/result4.pdf",
  "filename": "result4.pdf",
  "object_id": "abc",
  "object_type": "type_abc"
}
```

With this you can implement an error management, by testing if "success" = false, then there is an error. In this case you can display the statusCode and message to your user, and also add them to your logs for future reference.Example of error response sent to webhook:

```
{
  "success": false,
  "status_code": 403,
  "message": "Client error message: missing template, please provide template URL or ID",
  "result_file": "error",
  "filename": "error",
  "object_id": "abc",
  "object_type": "type_abc"
}
```

</details>

<details>

<summary>How to handle multiline inputs in Bubble?</summary>

When passing data in a JSON format with the docMaker Bubble plugin, if the data comes from a multiline input, you will have to use some formulas in order to format data properly:

1. First you have to use the "format as JSON-safe formula to your multiline input's value
2. Then you have to use a trick, which consist in replacing \n by \n, as shown in the screenshot below. It may seem odd, but it is the only solution currently for Bubble to accept line breaks inside a JSON value.

View in editor [here](https://bubble.io/page?type=page\&name=demo_docx_loops\&id=docmaker-plugins\&tab=tabs-2)

![](/files/dSrxpLvN7k89075pTu08)

</details>


# Questions on docx templates

<details>

<summary>How to add page breaks where needed in the template ?</summary>

In order to force page breaks, use this tag : {@pagebreak}&#x20;

Place it anywhere in your templtae, including in loops, and it will force the creation of a page break.

No need to change anything in the data you are sending to docMaker. Breaks are handled idrectly from the template.

</details>

<details>

<summary>How to avoid image cropping in tables</summary>

When generating a pdf based on a docx template, it may happen that images in tables could be cropped.\
Solution : you have to double the line spacing in the cell where your image tag (should look like {%image}) is located.

</details>


# Questions on pdf templates

## Coming soon


