General Guidelines

Generate Document From HTML Template using Power Automate

Guideline to generate PDF from Html template and Json data using Power Automate.
Html template is based on handlebars syntax.
Data is in Json format.
Follow these steps to generate PDF, sample HTML and Data is also attatched.
For Further help in html template or json data please contact Support

Follow these steps to Geneate Document from HTML Template using Power Automate.

  1. Create Template
  2. Document Data
  3. Generate Document
  4. Convert HTML to PDF
  5. Save the Output

1. Create Template

Follow our guidelines for creating html document template using Power Automate.
handlebars

Download document template sample.
Download template

2. Document Data

We support Json, Xml and CSV as Data format for generating document but Json format is recommended.
Data could be supplied as Document Data Text
Download the sample json.

Download invoice_data

3. Generate Document

Map the document Template from step one.
Map the document data from step two.
The document data could be provided in file or text filed.
Output format is supported in HTML.

4. Convert HTML to PDF

This method allows you to automate the process of turning HTML document to PDF document.

Fill in:

HTML Source: HTML content or file input

Layout: Portrait or Landscape

Output Type: PDF

File Name: Define the name (e.g., invoice.pdf)

5. Save the Output

Save the output file from PDF4me Step using Power Automate.
PDF4me often integrates with several cloud storage services like:

OneDrive
Google Drive
Dropbox
SharePoint

Map the Output from the PDF4me Step
The output file can be provided as a dynamic content field (like PDF File, Output File, etc.)

You select this output in the “File Content” or “File to Save” field of the “Save” step.

Configure the Save Step

You usually need to specify:

Folder Path – Where exactly to save the file.

File Name – You can define this statically or dynamically (using expressions like Converted_${Filename}.pdf).

File Content – This is where you insert the output file from the PDF4me step

Download Generated_PDF

Here is a look at the overall flow generated in Power Automate.