Skip to main content

Direct Conversion

The direct PDF conversion mode provides a quick and efficient way to generate PDFs by sending a POST request with a URL or HTML content for conversion. The API responds immediately with the raw PDF, ready for download or display. This Direct Mode endpoint is ideal for workflows that require real-time PDF generation, such as document rendering in web applications or dashboards. It provides the PDF directly in the response.

Endpoint Details

Method: POST

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

Example

Example for converting a URL directly into a PDF:

{
"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