Convert HTML or URL to PDF

Convert HTML or URL to PDF

Description

This action takes either raw HTML content or a URL, and generates a PDF file from it — with optional settings like margins, headers, footers, paper format, image quality, and page orientation.

Input Arguments

Input ArgumentTypeDescriptionRequired?Advanced Option?Default
HTML or URLHTML or URLThe HTML or URL content that will ne used to create the PDF File.✔️-
Landscape Format?BooleanSpecifies whether the PDF should be generated in landscape orientation (horizontal).✔️No
Quality of Image ContentNumberMaximum image quality (in pixels) for the included images.✔️800
Footer OptionsChoice FieldDisplay options in the document footer.✔️Nothing displayed by default
Header OptionsChoice FieldDisplay options in the document header.✔️Nothing displayed by default
Paper FormatChoice FieldDefines the paper format, e.g. A3, A5, Letter, etc.✔️A4
Top marginNumberDefines the top margin (in pixels) of the PDF.✔️20
Bottom marginNumberDefines the bottom margin (in pixels) of the PDF.✔️20
Left marginNumberDefines the left margin (in pixels) of the PDF.✔️20
Page RangesStringDefines which pages are to be printed, e.g. 1.-3,5 etc.✔️All pages
ScaleNumberDefines the scaling factor of the page content.✔️1

Output

ResponseTypeDescription
File responsePDFThe PDF response from the file.
File response as stringStringThe file content as a string. This can be stored in a variable, saved to Dataverse, or passed to other actions that require the file content in string format.
MIME typeStringThe MIME type of the PDF file.
ExtensionStringThe file extension (for this action always pdf).

Power Automate Examples

Convert URL to PDF

If you provide a URL (e.g., a website), the action will load the webpage and convert its visible content into a PDF file.

In our case, we use the following URL: https://en.wikipedia.org/wiki/Monkey (opens in a new tab) (last accessed on July 21, 2025).

Picture

Convert HTML to PDF

As input, you provide an HTML table.

Simple HTML table
<table border = "1">
<tr> 
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
</table>

Picture

💡

Looking for the response to this example? Scroll up to see the Output tab.

Known Limitations

⚠️
If you experienced other limitations please get in touch with us!