Skip to main content

Direct Conversion

The direct mode offers a quick and efficient approach to PDF generation by sending a POST request with URLs, HTML content, or template ID and JSON data. The API responds immediately with the raw PDF, ready for download or display. This endpoint is ideal for workflows requiring real-time PDF generation, such as document rendering in web applications or dashboards, delivering the PDF directly in the response.

Endpoint Details

Method: POST

https://api.pdfbolt.com/v1/direct

Example

Example for generating a PDF directly from a URL:

{
"url": "https://example.com"
}

Body Parameters

info

In this section, you will find only the parameters specific to the /direct endpoint. To view the list of common parameters shared across all endpoints, please refer to the Conversion Parameters section.

isEncoded

Type: boolean

Required: No

Default Value: false

Details: The isEncoded parameter determines the format of the PDF data returned in the response:

  • When set to true, the response contains the PDF data encoded in Base64 format, and the content type is text/plain.
  • When set to false or omitted, the response contains the raw PDF binary data, and the content type is application/pdf.

Usage:

{
"url": "https://example.com",
"isEncoded": true
}
warning

Be aware that Base64 encoding increases the size of the data by approximately 33%, which can impact data transfer times and storage requirements.

Response

The format of the response depends on the value of the isEncoded parameter. See the details below:

ValueResponse FormatContent Type
trueBase64-encoded PDFtext/plain
falseRaw PDF binaryapplication/pdf