Direct Conversion
The /v1/direct endpoint generates a PDF from a URL, HTML, or template ID and returns it directly in the response body. Use it when you need the PDF immediately: save to disk, attach to an email, or show an in-app preview while your user is waiting.
Endpoint Details
Method: POST
https://api.pdfbolt.com/v1/direct
Success Example
- Request
- cURL
- Response
Example request body for converting a URL to PDF:
{
"url": "https://example.com"
}
Complete request with authentication, saving the result as webpage.pdf:
curl 'https://api.pdfbolt.com/v1/direct' \
-H 'API-KEY: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' \
-H 'Content-Type: application/json' \
-d '{"url": "https://example.com"}' \
-o webpage.pdf
To save response headers (rate limits, conversion cost, content disposition) alongside the PDF, add -D headers.txt:
curl -D headers.txt 'https://api.pdfbolt.com/v1/direct' \
-H 'API-KEY: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' \
-H 'Content-Type: application/json' \
-d '{"url": "https://example.com"}' \
-o webpage.pdf
The response is a raw PDF file (or Base64-encoded PDF if isEncoded is true), ready for saving or further processing.

Failure Example
If the request fails (e.g., unauthorized, bad request, conversion timeout), the response is a JSON error object. See Error Handling for all error codes and recommended actions.
- Request
- Response
{
"url": "https://example.com",
"waitForFunction": "() => document.body.innerText.includes('Ready to Download')"
}
{
"timestamp": "2026-04-30T10:28:43Z",
"httpErrorCode": 408,
"errorCode": "CONVERSION_TIMEOUT",
"errorMessage": "Conversion process timed out. Please see https://pdfbolt.com/docs/parameters#timeout, https://pdfbolt.com/docs/parameters#waituntil and https://pdfbolt.com/docs/parameters#waitforfunction parameters."
}
Body Parameters
Below are only the parameters specific to the /direct endpoint. For common parameters shared across all endpoints, see Conversion Parameters.
isEncoded
Type: boolean
Required: No
Default Value: false
Details:
The isEncoded parameter determines the format of the PDF data returned in the response:
- When
true: returns Base64-encoded PDF withContent-Type: text/plain. - When
false(default): returns raw PDF binary withContent-Type: application/pdf.
Usage:
{
"url": "https://example.com",
"isEncoded": true
}
Base64-encoded responses are approximately 33% larger than raw binary, increasing transfer time and storage usage.
Response
The response format depends on the isEncoded parameter:
| Value | Response Format | Content Type |
|---|---|---|
true | Base64-encoded PDF | text/plain |
false | Raw PDF binary | application/pdf |
For response headers, see API Response Headers.
Next Steps
📄️ Quick Start Guide
Code samples in Node.js, Python, Java, PHP, C#, Go, Rust
📄️ Conversion Parameters
Full reference for all PDF generation parameters