New: PDF/A-3b conversion with a compliance report included.See Docs

Convert HTML to PDF with PDF.co using Make

3 Minutes Read

In this tutorial, we will show you how to convert HTML to PDF with PDF.co using Make.

Step 1: Create a New Scenario

First, let’s start by Creating a New Scenario.

Step 2: PDF.co App and Convert HTML to PDF

Next, select the PDF.co module and choose the Convert HTML to PDF for the conversion into PDF.

Convert HTML to PDF

Step 3: Configure PDF.co

Create or select your PDF.co connection using your OAuth or your API key, then configure the module:

  • Convert Options: Select HTML to PDF.
  • Input HTML Code: Paste the complete HTML document below.
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Service summary</title>
</head>
<body>
  <h1>Service summary</h1>
  <p>Customer: Example Company</p>
  <p>Reference: DEMO-001</p>
  <p>Work completed: Document review</p>
</body>
</html>

For this initial test, use these settings:

  • Output File Name: service-summary.pdf
  • Orientation: Portrait
  • Paper Size: A4
  • Margins: 10mm
  • Export Type: Download a File

Generate the PDF with these fixed values first. Open it and check the text, paper size, and margins.

Add Dynamic Values

After the fixed example works, replace the sample customer, reference, and work description with mapped fields from a preceding Make module. Keep the HTML tags in place.

Encode special characters in incoming text so that customer data is treated as text rather than HTML. For example, Example & Company should be inserted as Example &amp; Company. Apply encoding to the incoming values, not the complete HTML document.

Test one input record and confirm that its values appear correctly in the PDF. If you add images or fonts, their URLs must be accessible to the converter.

To retain the PDF, add your storage service’s upload module and map the PDF.co module’s output Data as the file content. Save the file before its temporary download link expires.

Step 4: Test Result

Great! We successfully converted the HTML to PDF. You can copy and paste the URL to view the output.

Output URL

Step 5: Output

Here’s the converted HTML to PDF output.

Converted HTML to PDF
Converted HTML to PDF

In this tutorial, you learned how to convert HTML to PDF with PDF.co using Make. You learned how to use the raw HTML code. You also learned how to use the HTML to PDF Web API.

Video Guide

Related Tutorials

See Related Tutorials