Link Search Menu Expand Document

PDF from HTML Template

Description: Creates PDF from HTML template. POST request.

Status Errors

CodeDescription
200The request has succeeded
400bad input parameters
401unauthorized
403not enough credits
405Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info

PDF.co supports {{Mustache}} style HTML templates. For example, you can set templateData property to JSON like this { invoice: { company: \"ACME Company\"}} and {{invoice.company}} inside template will be replaced with ACME Company.

For more information about Handlebars & Mustache templates please visit https://handlebarsjs.com/.

Available Methods

[POST] /pdf/convert/from/html (json input)

Automate and scale PDF generation using built-in PDF.co HTML templates. API loads data from templateData parameter and uses this data to inject data into your html template.

Create, test and manage your HTML templates here

Templates use {{Mustache}} and Handlebars templating syntax. You just need to insert macros surrounded by double brackets like {{ and }}.

  • More about {{Mustache}} templates here
  • More about {{Handlebars}} advanced templates here

Some Examples of macro inside html template:

  • {{variable1}} will be replaced with test if you set templateData to { "variable1": "test"}
  • {{object1.variable1}} will be replaced with test if you set templateData to { "object1": { "variable1": "test"} }
  • simple conditions are also supported. For example: {{#if paid}} invoice was paid {{/if}} will show invoice was paid when templateData is set to { "paid": true }

Parameters

  • templateId required. Set to the ID of your html template. You can find and copy ID at HTML templates section in the app.
  • templateData required, string. Set it to a string with input JSON data (recommended) or from CSV data.

Sample JSON input:

"templateData": "{ 'paid': true, 'invoice_id': '0002', 'total': '$999.99' }"

NOTE: If you use JSON as input then make sur to escape it first (with JSON.stringify(dataObject) in JS). Escaping is when every " is replaced with \" (most programming languages are doing it automatically though.

Example with " be escaped as \" then:

"templateData": "{ \"paid\": true, \"invoice_id\": \"0002\", \"total\": \"$999.99\" }"

You can also use simple CSV as input:

"templateData": "paid,invoice_id,total
true,0002,$999.99"
  • margins optional. set to css style margins like 10px, 5mm, 5in for all sides or 5px 5px 5px 5px (the order of margins is top, right, bottom, left).
  • orientation optional. set to Portrait or Landscape. Portrait by default.
  • paperSize optional. Letter is set by default. Can be Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6 or a custom size. Custom size can be set in px (pixels), mm or in (inches) with width and height separated by space like this: 200 300, 200px 300px, 200mm 300mm, 20cm 30cm or 6in 8in.
  • printBackground optional. true by default. Set to false to disable printing of background.
  • header optional. Set to HTML for header to be applied on every page at the header.
  • footer optional. Set to HTML for footer to be applied on every page at the bottom.

The header and footer params should contain valid HTML markup with the following classes used to inject printing values into them:

date: formatted print date title: document title url: document location pageNumber: current page number totalPages: total pages in the document

For example, the following markup will generate Page N of NN page numbering:

<span style='font-size:10px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span>.</span>

Sample for HTML PDF generation with more advanced header and footer. Note that the top and bottom page margins are important because the page content may overlap the footer or header.

{
 "html": ""<!DOCTYPE html><html><head><meta charSet=\"utf-8\"/><style type=\"text/css\">body { font-family: \"Arial\" }</style></head><body><h1>Hello</h1></body></html>",
  "async": false,
  "encrypt": false,
  "name": "result.pdf",
  "margins": "40px 5px 40px 5px",
  "paperSize": "Letter",
  "orientation": "Portrait",
  "printBackground": true,
  "header": "<div style='width:100%'><span style='font-size:10px;margin-left:20px;width:50%;float:left'>LEFT SUBHEADER</span><span style='font-size:8px;width:30%;float:right'>RIGHT SUBHEADER</span></div>",
  "footer": "<div style='width:100%;text-align:right'><span style='font-size:10px;margin-right:20px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span>.</span></div>"
}
  • async optional. Set to true to run as async job in background (recommended for heavy documents).
  • profiles optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.

  • Method: POST
  • URL: /v1/pdf/convert/from/html

Query parameters

No query parameters accepted.

Body payload

{
    "templateId": 1,
    "name": "newDocument.pdf",
    "margins": "40px 20px 20px 20px",
    "paperSize": "Letter",
    "orientation": "Portrait",
    "printBackground": true,
    "header": "",
    "footer": "",
    "async": false,
    "encrypt": false,
    "templateData": "{\"paid\": true,\"invoice_id\": \"0021\",\"invoice_date\": \"August 29, 2041\",\"invoice_dateDue\": \"September 29, 2041\",\"issuer_name\": \"Sarah Connor\",\"issuer_company\": \"T-800 Research Lab\",\"issuer_address\": \"435 South La Fayette Park Place, Los Angeles, CA 90057\",\"issuer_website\": \"www.example.com\",\"issuer_email\": \"info@example.com\",\"client_name\": \"Cyberdyne Systems\",\"client_company\": \"Cyberdyne Systems\",\"client_address\": \"18144 El Camino Real, Sunnyvale, California\",\"client_email\": \"sales@example.com\",\"items\": [    {    \"name\": \"T-800 Prototype Research\",    \"price\": 1000.00    },    {    \"name\": \"T-800 Cloud Sync Setup\",    \"price\": 300.00    }  ],\"discount\": 100,\"tax\": 87,\"total\": 1287,\"note\": \"Thank you for your support of advanced robotics.\"}"
}

Example responses

/pdf/convert/from/html (json input)
{
    "url": "https://pdf-temp-files.s3.amazonaws.com/a2cd107f504740a5bddec4cb8dd3f76a/newDocument.pdf",
    "pageCount": 1,
    "error": false,
    "status": 200,
    "name": "newDocument.pdf",
    "remainingCredits": 99072306,
    "credits": 9
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/pdf/convert/from/html' \
--header 'x-api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "templateId": 1,
    "name": "newDocument.pdf",
    "margins": "40px 20px 20px 20px",
    "paperSize": "Letter",
    "orientation": "Portrait",
    "printBackground": true,
    "header": "",
    "footer": "",
    "async": false,
    "encrypt": false,
    "templateData": "{\"paid\": true,\"invoice_id\": \"0021\",\"invoice_date\": \"August 29, 2041\",\"invoice_dateDue\": \"September 29, 2041\",\"issuer_name\": \"Sarah Connor\",\"issuer_company\": \"T-800 Research Lab\",\"issuer_address\": \"435 South La Fayette Park Place, Los Angeles, CA 90057\",\"issuer_website\": \"www.example.com\",\"issuer_email\": \"info@example.com\",\"client_name\": \"Cyberdyne Systems\",\"client_company\": \"Cyberdyne Systems\",\"client_address\": \"18144 El Camino Real, Sunnyvale, California\",\"client_email\": \"sales@example.com\",\"items\": [    {    \"name\": \"T-800 Prototype Research\",    \"price\": 1000.00    },    {    \"name\": \"T-800 Cloud Sync Setup\",    \"price\": 300.00    }  ],\"discount\": 100,\"tax\": 87,\"total\": 1287,\"note\": \"Thank you for your support of advanced robotics.\"}"
}'

[POST] /pdf/convert/from/html (csv input)

Automate and scale PDF generation using built-in PDF.co HTML templates. API loads data from templateData parameter and uses this data to inject data into your html template.

Create, test and manage your HTML templates here

Templates use {{Mustache}} and Handlebars templating syntax. You just need to insert macros surrounded by double brackets like {{ and }}.

  • More about {{Mustache}} templates here
  • More about {{Handlebars}} advanced templates here

Some Examples of macro inside html template:

  • {{variable1}} will be replaced with test if you set templateData to { "variable1": "test"}
  • {{object1.variable1}} will be replaced with test if you set templateData to { "object1": { "variable1": "test"} }
  • simple conditions are also supported. For example: {{#if paid}} invoice was paid {{/if}} will show invoice was paid when templateData is set to { "paid": true }

Parameters

  • templateId required. Set to the ID of your html template. You can find and copy ID at HTML templates section in the app.
  • templateData required, string. Set it to a string with input JSON data (recommended) or from CSV data.

Sample JSON input:

"templateData": "{ 'paid': true, 'invoice_id': '0002', 'total': '$999.99' }"

NOTE: If you use JSON as input then make sur to escape it first (with JSON.stringify(dataObject) in JS). Escaping is when every " is replaced with \" (most programming languages are doing it automatically though.

Example with " be escaped as \" then:

"templateData": "{ \"paid\": true, \"invoice_id\": \"0002\", \"total\": \"$999.99\" }"

You can also use simple CSV as input:

"templateData": "paid,invoice_id,total
true,0002,$999.99"
  • margins optional. set to css style margins like 10px, 5mm, 5in for all sides or 5px 5px 5px 5px (the order of margins is top, right, bottom, left).
  • orientation optional. set to Portrait or Landscape. Portrait by default.
  • paperSize optional. Letter is set by default. Can be Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6 or a custom size. Custom size can be set in px (pixels), mm or in (inches) with width and height separated by space like this: 200 300, 200px 300px, 200mm 300mm, 20cm 30cm or 6in 8in.
  • printBackground optional. true by default. Set to false to disable printing of background.
  • header optional. Set to HTML for header to be applied on every page at the header.
  • footer optional. Set to HTML for footer to be applied on every page at the bottom.

The header and footer params should contain valid HTML markup with the following classes used to inject printing values into them:

date: formatted print date title: document title url: document location pageNumber: current page number totalPages: total pages in the document

For example, the following markup will generate Page N of NN page numbering:

<span style='font-size:10px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span>.</span>

Sample for HTML PDF generation with more advanced header and footer. Note that the top and bottom page margins are important because the page content may overlap the footer or header.

{
 "html": ""<!DOCTYPE html><html><head><meta charSet=\"utf-8\"/><style type=\"text/css\">body { font-family: \"Arial\" }</style></head><body><h1>Hello</h1></body></html>",
  "async": false,
  "encrypt": false,
  "name": "result.pdf",
  "margins": "40px 5px 40px 5px",
  "paperSize": "Letter",
  "orientation": "Portrait",
  "printBackground": true,
  "header": "<div style='width:100%'><span style='font-size:10px;margin-left:20px;width:50%;float:left'>LEFT SUBHEADER</span><span style='font-size:8px;width:30%;float:right'>RIGHT SUBHEADER</span></div>",
  "footer": "<div style='width:100%;text-align:right'><span style='font-size:10px;margin-right:20px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span>.</span></div>"
}
  • async optional. Set to true to run as async job in background (recommended for heavy documents).
  • profiles optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.

  • Method: POST
  • URL: /v1/pdf/convert/from/html

Query parameters

No query parameters accepted.

Body payload

{
    "templateId": 1,
    "name": "newDocument.pdf",
    "margins": "40px 20px 20px 20px",
    "paperSize": "Letter",
    "orientation": "Portrait",
    "printBackground": true,
    "header": "",
    "footer": "",
    "async": false,
    "encrypt": false,
    "templateData": "{\"paid\": true,\"invoice_id\": \"0021\",\"invoice_date\": \"August 29, 2041\",\"invoice_dateDue\": \"September 29, 2041\",\"issuer_name\": \"Sarah Connor\",\"issuer_company\": \"T-800 Research Lab\",\"issuer_address\": \"435 South La Fayette Park Place, Los Angeles, CA 90057\",\"issuer_website\": \"www.example.com\",\"issuer_email\": \"info@example.com\",\"client_name\": \"Cyberdyne Systems\",\"client_company\": \"Cyberdyne Systems\",\"client_address\": \"18144 El Camino Real, Sunnyvale, California\",\"client_email\": \"sales@example.com\",\"items\": [    {    \"name\": \"T-800 Prototype Research\",    \"price\": 1000.00    },    {    \"name\": \"T-800 Cloud Sync Setup\",    \"price\": 300.00    }  ],\"discount\": 100,\"tax\": 87,\"total\": 1287,\"note\": \"Thank you for your support of advanced robotics.\"}"
}

Example responses

/pdf/convert/from/html (csv data input)
{
    "url": "https://pdf-temp-files.s3.amazonaws.com/6fc1712ba6274b06a88329cffd5ab217/newDocument.pdf",
    "pageCount": 1,
    "error": false,
    "status": 200,
    "name": "newDocument.pdf",
    "remainingCredits": 98962241,
    "credits": 9
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/pdf/convert/from/html' \
--header 'x-api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "templateId": 1,
    "name": "newDocument.pdf",
    "margins": "40px 20px 20px 20px",
    "paperSize": "Letter",
    "orientation": "Portrait",
    "printBackground": true,
    "header": "",
    "footer": "",
    "async": false,
    "encrypt": false,
    "templateData": "{\"paid\": true,\"invoice_id\": \"0021\",\"invoice_date\": \"August 29, 2041\",\"invoice_dateDue\": \"September 29, 2041\",\"issuer_name\": \"Sarah Connor\",\"issuer_company\": \"T-800 Research Lab\",\"issuer_address\": \"435 South La Fayette Park Place, Los Angeles, CA 90057\",\"issuer_website\": \"www.example.com\",\"issuer_email\": \"info@example.com\",\"client_name\": \"Cyberdyne Systems\",\"client_company\": \"Cyberdyne Systems\",\"client_address\": \"18144 El Camino Real, Sunnyvale, California\",\"client_email\": \"sales@example.com\",\"items\": [    {    \"name\": \"T-800 Prototype Research\",    \"price\": 1000.00    },    {    \"name\": \"T-800 Cloud Sync Setup\",    \"price\": 300.00    }  ],\"discount\": 100,\"tax\": 87,\"total\": 1287,\"note\": \"Thank you for your support of advanced robotics.\"}"
}'

[POST] /pdf/convert/from/html (advanced template with auto calc)

Automate and scale PDF generation using built-in PDF.co HTML templates. API loads data from templateData parameter and uses this data to inject data into your html template.

Create, test and manage your HTML templates here

Templates use {{Mustache}} and Handlebars templating syntax. You just need to insert macros surrounded by double brackets like {{ and }}.

  • More about {{Mustache}} templates here
  • More about {{Handlebars}} advanced templates here

Some Examples of macro inside html template:

  • {{variable1}} will be replaced with test if you set templateData to { "variable1": "test"}
  • {{object1.variable1}} will be replaced with test if you set templateData to { "object1": { "variable1": "test"} }
  • simple conditions are also supported. For example: {{#if paid}} invoice was paid {{/if}} will show invoice was paid when templateData is set to { "paid": true }

Parameters

  • templateId required. Set to the ID of your html template. You can find and copy ID at HTML templates section in the app.
  • templateData required, string. Set it to a string with input JSON data (recommended) or from CSV data.

Sample JSON input:

"templateData": "{ 'paid': true, 'invoice_id': '0002', 'total': '$999.99' }"

NOTE: If you use JSON as input then make sur to escape it first (with JSON.stringify(dataObject) in JS). Escaping is when every " is replaced with \" (most programming languages are doing it automatically though.

Example with " be escaped as \" then:

"templateData": "{ \"paid\": true, \"invoice_id\": \"0002\", \"total\": \"$999.99\" }"

You can also use simple CSV as input:

"templateData": "paid,invoice_id,total
true,0002,$999.99"
  • margins optional. set to css style margins like 10px, 5mm, 5in for all sides or 5px 5px 5px 5px (the order of margins is top, right, bottom, left).
  • orientation optional. set to Portrait or Landscape. Portrait by default.
  • paperSize optional. Letter is set by default. Can be Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6 or a custom size. Custom size can be set in px (pixels), mm or in (inches) with width and height separated by space like this: 200 300, 200px 300px, 200mm 300mm, 20cm 30cm or 6in 8in.
  • printBackground optional. true by default. Set to false to disable printing of background.
  • header optional. Set to HTML for header to be applied on every page at the header.
  • footer optional. Set to HTML for footer to be applied on every page at the bottom.

The header and footer params should contain valid HTML markup with the following classes used to inject printing values into them:

date: formatted print date title: document title url: document location pageNumber: current page number totalPages: total pages in the document

For example, the following markup will generate Page N of NN page numbering:

<span style='font-size:10px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span>.</span>

Sample for HTML PDF generation with more advanced header and footer. Note that the top and bottom page margins are important because the page content may overlap the footer or header.

{
 "html": ""<!DOCTYPE html><html><head><meta charSet=\"utf-8\"/><style type=\"text/css\">body { font-family: \"Arial\" }</style></head><body><h1>Hello</h1></body></html>",
  "async": false,
  "encrypt": false,
  "name": "result.pdf",
  "margins": "40px 5px 40px 5px",
  "paperSize": "Letter",
  "orientation": "Portrait",
  "printBackground": true,
  "header": "<div style='width:100%'><span style='font-size:10px;margin-left:20px;width:50%;float:left'>LEFT SUBHEADER</span><span style='font-size:8px;width:30%;float:right'>RIGHT SUBHEADER</span></div>",
  "footer": "<div style='width:100%;text-align:right'><span style='font-size:10px;margin-right:20px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span>.</span></div>"
}
  • async optional. Set to true to run as async job in background (recommended for heavy documents).
  • profiles optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.

  • Method: POST
  • URL: /v1/pdf/convert/from/html

Query parameters

No query parameters accepted.

Body payload

{
    "templateId": 2,
    "name": "newDocument.pdf",
    "margins": "40px 20px 20px 20px",
    "paperSize": "Letter",
    "orientation": "Portrait",
    "printBackground": true,
    "header": "",
    "footer": "",
    "async": false,
    "encrypt": false,
    "templateData": "{\"paid\": true,\"invoice_id\": \"0021\",\"invoice_date\": \"August 29, 2041\",\"invoice_dateDue\": \"September 29, 2041\",\"issuer_name\": \"Sarah Connor\",\"issuer_company\": \"T-800 Research Lab\",\"issuer_address\": \"435 South La Fayette Park Place, Los Angeles, CA 90057\",\"issuer_website\": \"www.example.com\",\"issuer_email\": \"info@example.com\",\"client_name\": \"Cyberdyne Systems\",\"client_company\": \"Cyberdyne Systems\",\"client_address\": \"18144 El Camino Real, Sunnyvale, California\",\"client_email\": \"sales@example.com\",\"items\": [  {\"name\": \"T-800 Prototype Research\",\"price\": 1000.0  },  {\"name\": \"T-800 Cloud Sync Setup\",\"price\": 300.0  }],\"discount\": 0.1,\"tax\": 0.0725,\"note\": \"Thank you for your support of advanced robotics.\"}"
}

Example responses

/pdf/convert/from/html (using template with auto calc)
{
    "url": "https://pdf-temp-files.s3.amazonaws.com/31a398c79ab14d27b029f268cf9660c8/newDocument.pdf",
    "pageCount": 1,
    "error": false,
    "status": 200,
    "name": "newDocument.pdf",
    "remainingCredits": 99003839,
    "credits": 9
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/pdf/convert/from/html' \
--header 'x-api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "templateId": 2,
    "name": "newDocument.pdf",
    "margins": "40px 20px 20px 20px",
    "paperSize": "Letter",
    "orientation": "Portrait",
    "printBackground": true,
    "header": "",
    "footer": "",
    "async": false,
    "encrypt": false,
    "templateData": "{\"paid\": true,\"invoice_id\": \"0021\",\"invoice_date\": \"August 29, 2041\",\"invoice_dateDue\": \"September 29, 2041\",\"issuer_name\": \"Sarah Connor\",\"issuer_company\": \"T-800 Research Lab\",\"issuer_address\": \"435 South La Fayette Park Place, Los Angeles, CA 90057\",\"issuer_website\": \"www.example.com\",\"issuer_email\": \"info@example.com\",\"client_name\": \"Cyberdyne Systems\",\"client_company\": \"Cyberdyne Systems\",\"client_address\": \"18144 El Camino Real, Sunnyvale, California\",\"client_email\": \"sales@example.com\",\"items\": [  {\"name\": \"T-800 Prototype Research\",\"price\": 1000.0  },  {\"name\": \"T-800 Cloud Sync Setup\",\"price\": 300.0  }],\"discount\": 0.1,\"tax\": 0.0725,\"note\": \"Thank you for your support of advanced robotics.\"}"
}'

[GET] /templates/html

Return all HTML templates for current user. Please use GET request.

Manage HTML templates at https://app.pdf.co/templates/html

  • Method: GET
  • URL: /v1/templates/html

Query parameters

No query parameters accepted.

Body payload

No body parameters accepted.

Example responses

/templates/html
{
    "templates": [
        {
            "id": 1,
            "type": "system",
            "title": "General Invoice Template",
            "description": "sample invoice template showcasing use of Mustache templates syntax for generating invoices"
        },
        {
            "id": 15,
            "type": "user",
            "title": "User Template 1",
            "description": ""
        }
    ],
    "remainingCredits": 99204004,
    "credits": 2
}

Code Snippet

CURL
curl --location --request GET 'https://api.pdf.co/v1/templates/html' \
--header 'Content-Type: application/json' \
--header 'x-api-key: '

[GET] /templates/html/:id

Returns HTML template by template’s id. Please use GET request.

Manage HTML templates at https://app.pdf.co/templates/html

  • Method: GET
  • URL: /v1/templates/html/:id

Query parameters

No query parameters accepted.

Body payload

No body parameters accepted.

Example responses

/templates/html/:id
{
    "id": 1,
    "type": "system",
    "title": "General Invoice Template",
    "description": "sample invoice template showcasing use of Mustache templates syntax for generating invoices",
    "body": "<!doctype html>\r\n<html lang=\"en-US\">\r\n<head>\r\n<title>Invoice  </title>    \r\n<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css\" integrity=\"sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn\" crossorigin=\"anonymous\">\r\n</head>    \r\n<body>\r\n    \r\n    <div style=\"border-width: 3px;border-style: solid; border-color: #008000;border-radius: 8px; color: #008000; opacity:0.4; position: absolute; z-index: 1; left:80%; top:3%; font-size: 60pt;transform: rotate(-20deg)\">\r\n    PAID </div>\r\n    \r\n    \r\n    <div class=\"container\">\r\n        <div class=\"\">\r\n            <div class=\"\">\r\n                \r\n                <!-- invoice: header begin-->\r\n                <div class=\"row col-md-12\">\r\n                    <div class=\"col col-md-6\">\r\n                            <div class=\"font-weight-bold\"></div>\r\n\r\n                            <div  class=\"\"></div>\r\n                            <div class=\"\"></div>\r\n                            <div class=\"\"></div>\r\n                            <div class=\"\"></div>\r\n                    </div>\r\n                    <div class=\"col col-md-6\">\r\n                        <div class=\"\">\r\n                            <div class=\"\">\r\n                                <span class=\"font-weight-bold\">Invoice Number:</span> \r\n                            </div>\r\n                            <div class=\"\">\r\n                                <span class=\"font-weight-bold\">Invoice Date:</span> \r\n                            </div>\r\n                            <div class=\"\">\r\n                                <span class=\"font-weight-bold\">Invoice Due Date:</span> \r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                \r\n<div class=\"row col-md-12\">\r\n                    <div class=\"col col-md-6\"></div>\r\n\r\n                    <div class=\"col col-md-6\">\r\n                        <div class=\"font-weight-bold footer-title\">BILL TO</div>\r\n                        <div class=\"\">\r\n                            <div class=\"\"><strong>Name:</strong> </div>\r\n                            <div class=\"\"><strong>Company:</strong> </div>\r\n                            <div class=\"\"><strong>Address:</strong> </div>\r\n                            <div  class=\"\"><strong>Email:</strong> </div>\r\n                        </div>\r\n                    </div>    \r\n                </div>\r\n                \r\n                <div class=\"row col-md-12\">\r\n                    <div class=\"col col-md-12\">\r\n                    <table class=\"table table-striped\" cellspacing=\"0\">\r\n                        <thead>\r\n                            <tr class=\"table-head\">\r\n                                <th class=\"text-left\">Item</th>\r\n                                <th class=\"text-right\">Price</th>\r\n                            </tr>\r\n                        </thead>\r\n                        <tbody>\r\n                            \r\n                            <tr>\r\n                                <td class=\"text-left\"></td>\r\n                                <td class=\"text-right\"></td>\r\n                            </tr>\r\n                            \r\n                        </tbody>\r\n                    </table>                                        \r\n                    </div>                                       \r\n\r\n                </div>\r\n                <div class=\"row col-md-12\">\r\n                  <div class=\"col col-md-6\">\r\n                  </div>\r\n                    <div class=\"col col-md-6 text-right\">\r\n                        <div style=\"margin-bottom: 10px;\">Discount:   <span class=\"amount\"></span></div>\r\n                        <div style=\"margin-bottom: 10px;\">Tax:   <span class=\"amount\"></span></div>\r\n                        <div class=\"font-weight-bold footer-title\">TOTAL: <span class=\"total-amount amount font-weight-bold\"></span></div>                        \r\n                    </div>\r\n                    \r\n                </div>\r\n                </div>                \r\n            </div>\r\n        </div>\r\n        <div class=\"container text-muted\"></div>\r\n    </div>\r\n</body>\r\n</html>\r\n​",
    "remainingCredits": 99204002,
    "credits": 2
}

Code Snippet

CURL
curl --location --request GET 'https://api.pdf.co/v1/templates/html/1' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ' \
--data-raw ''