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
- Log in to your PDFGen Studio Dashboard
- Navigate to Settings → API Keys
- Click Create New API Key
- 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:
| Renderer | Use Case | Endpoint |
|---|---|---|
| Template | Render pre-designed templates with dynamic data | POST /api/v1/renderer/templates/:id |
| JSON | Generate documents from JSON definitions | POST /api/v1/renderer/json |
| HTML | Convert HTML/CSS to PDF or images | POST /api/v1/renderer/html |
| URL | Capture any webpage as PDF or screenshot | POST /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
- Explore the API Reference for detailed endpoint documentation
- Learn about Authentication options
- Check out the Options Reference for customization