Skip to main content

Getting Started

Get up and running with PDFGen Studio in just a few minutes.

Prerequisites

  • A PDFGen Studio account
  • An API key (obtained from your dashboard)

Step 1: Get Your API Key

  1. Log in to your PDFGen Studio Dashboard
  2. Navigate to SettingsAPI Keys
  3. Click Create New API Key
  4. Copy and securely store your API key
caution

Keep your API key secure! Never expose it in client-side code or public repositories.

Step 2: Make Your First API Call

Test your setup with a simple HTML to PDF conversion:

curl -X POST "https://api.pdfgenstudio.com/api/v1/renderer/html" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"html": "<h1>Hello, PDFGen Studio!</h1><p>This is my first PDF.</p>"
}' \
--output hello.pdf

Step 3: Choose Your Renderer

PDFGen Studio offers four powerful rendering endpoints:

RendererUse CaseEndpoint
TemplateRender pre-designed templates with dynamic dataPOST /api/v1/renderer/templates/:id
JSONGenerate documents from JSON definitionsPOST /api/v1/renderer/json
HTMLConvert HTML/CSS to PDF or imagesPOST /api/v1/renderer/html
URLCapture any webpage as PDF or screenshotPOST /api/v1/renderer/url

Code Examples

Node.js

const response = await fetch('https://api.pdfgenstudio.com/api/v1/renderer/html', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
html: '<h1>Hello World</h1>',
options: {
format: 'A4',
orientation: 'portrait',
},
}),
});

const pdfBuffer = await response.arrayBuffer();

Python

import requests

response = requests.post(
'https://api.pdfgenstudio.com/api/v1/renderer/html',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'html': '<h1>Hello World</h1>',
'options': {
'format': 'A4',
'orientation': 'portrait',
},
},
)

with open('output.pdf', 'wb') as f:
f.write(response.content)

Next Steps