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
- Request
- Response
Example for converting a URL directly into a PDF:
{
"url": "https://example.com"
}
The response is a raw PDF file, ready for saving or further processing.
Body Parameters
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 istext/plain
. - When set to
false
or omitted, the response contains the raw PDF binary data, and the content type isapplication/pdf
.
Usage:
{
"url": "https://example.com",
"isEncoded": true
}
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:
Value | Response Format | Content Type |
---|---|---|
true | Base64-encoded PDF | text/plain |
false | Raw PDF binary | application/pdf |