Skip to content

Quick Start

Get started with OffloadPDF in four simple steps:

1. Sign up and subscribe

Access the dashboard and select a plan. All plans include a 7-day free trial.

2. Create an API token

Generate your API token from the API Tokens page in your dashboard. Your token will only be shown once, so store it securely.

3. Make your first API call

Send a POST request to the API endpoint with your HTML content:

bash
curl -X POST https://app.offloadpdf.com/api/v1/pdf \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"html": "<h1>Hello World</h1><p>My first PDF!</p>"}'
js
fetch('https://app.offloadpdf.com/api/v1/pdf', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    html: '<h1>Hello World</h1><p>My first PDF!</p>'
  })
})
  .then(response => response.json())
  .then(data => {
    // data.pdf_content contains the base64 PDF string
    console.log(data.pdf_content);
  })
  .catch(error => {
    console.error('Error:', error);
  });
php
$response = Http::withToken('YOUR_API_TOKEN')
              ->post(
                'https://app.offloadpdf.com/api/v1/pdf',
                ['html' => '<h1>Hello World</h1><p>My first PDF!</p>']
              );
php
$response = wp_remote_post([
    'url'     => 'https://app.offloadpdf.com/api/v1/pdf',
    'method'  => 'POST',
    'headers' => [
        'Authorization' => 'Bearer YOUR_API_TOKEN',
        'Content-Type'  => 'application/json',
    ],
    'body'    => json_encode([
        'html' => '<h1>Hello World</h1><p>My first PDF!</p>',
    ])
]);

4. Decode the response

The JSON response contains base64-encoded PDF content:

json
{
  "pdf_content": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8P..."
}

Decode the base64 string to get your PDF file.