Stirling PDF provides a comprehensive REST API for automating PDF operations.
| Environment | URL |
|---|---|
| Development | http://localhost:8080/api/v1 |
| Production | https://pdf.app.bauer-group.com/api/v1 |
Interactive API documentation available at:
- Swagger UI:
/swagger-ui/index.html - OpenAPI JSON:
/v3/api-docs
# Header-based
curl -H "X-Api-Key: your-api-key" \
https://pdf.app.bauer-group.com/api/v1/info/statusConfigure in .env:
SECURITY_CUSTOM_GLOBAL_API_KEY=your-secure-api-keyEach user can create their own API key in the web interface.
# Check status
GET /api/v1/info/status
# Application information
GET /api/v1/info/app
# Available languages
GET /api/v1/info/languagesExample:
curl https://pdf.app.bauer-group.com/api/v1/info/statusResponse:
{
"status": "UP",
"version": "0.32.0"
}POST /api/v1/general/merge-pdfsParameters:
| Name | Type | Description |
|---|---|---|
fileInput |
file[] |
PDF files to merge |
Example:
curl -X POST \
-H "X-Api-Key: your-api-key" \
-F "fileInput=@document1.pdf" \
-F "fileInput=@document2.pdf" \
https://pdf.app.bauer-group.com/api/v1/general/merge-pdfs \
-o merged.pdfPOST /api/v1/general/split-pdf-by-pagesParameters:
| Name | Type | Description |
|---|---|---|
fileInput |
file |
PDF file |
pageNumbers |
string |
Page ranges (e.g., "1-5,10,15-20") |
POST /api/v1/general/rotate-pdfParameters:
| Name | Type | Description |
|---|---|---|
fileInput |
file |
PDF file |
angle |
integer |
Angle (90, 180, 270) |
POST /api/v1/convert/pdf/imgParameters:
| Name | Type | Description |
|---|---|---|
fileInput |
file |
PDF file |
imageFormat |
string |
Format (png, jpg, gif, webp) |
colorType |
string |
Color type (color, gray, bw) |
dpi |
integer |
Resolution (default: 300) |
POST /api/v1/convert/img/pdfPOST /api/v1/convert/file/pdfSupported formats: DOCX, XLSX, PPTX, ODT, ODS, ODP, etc.
POST /api/v1/convert/html/pdfPOST /api/v1/misc/ocr-pdfParameters:
| Name | Type | Description |
|---|---|---|
fileInput |
file |
PDF file |
languages |
string[] |
OCR languages (eng, deu, fra, etc.) |
sidecar |
boolean |
Create text file |
deskew |
boolean |
Align pages |
clean |
boolean |
Clean background |
Example:
curl -X POST \
-H "X-Api-Key: your-api-key" \
-F "fileInput=@scanned-document.pdf" \
-F "languages=eng" \
-F "sidecar=true" \
https://pdf.app.bauer-group.com/api/v1/misc/ocr-pdf \
-o ocr-result.pdfPOST /api/v1/security/add-passwordParameters:
| Name | Type | Description |
|---|---|---|
fileInput |
file |
PDF file |
password |
string |
Password |
keyLength |
integer |
Key length (40, 128, 256) |
POST /api/v1/security/remove-passwordPOST /api/v1/security/sanitize-pdfPOST /api/v1/misc/add-watermarkParameters:
| Name | Type | Description |
|---|---|---|
fileInput |
file |
PDF file |
watermarkText |
string |
Watermark text |
fontSize |
integer |
Font size |
rotation |
integer |
Rotation (0-360) |
opacity |
float |
Transparency (0-1) |
POST /api/v1/misc/compress-pdfParameters:
| Name | Type | Description |
|---|---|---|
fileInput |
file |
PDF file |
optimizeLevel |
integer |
Level (1-5, higher = smaller) |
Multiple files in one request:
curl -X POST \
-H "X-Api-Key: your-api-key" \
-F "fileInput=@file1.pdf" \
-F "fileInput=@file2.pdf" \
-F "fileInput=@file3.pdf" \
https://pdf.app.bauer-group.com/api/v1/general/merge-pdfs \
-o combined.pdf| Code | Description |
|---|---|
| 200 | Success |
| 400 | Invalid request |
| 401 | Not authenticated |
| 403 | No permission |
| 413 | File too large |
| 500 | Server error |
{
"timestamp": "2025-01-05T10:30:00Z",
"status": 400,
"error": "Bad Request",
"message": "Invalid PDF file",
"path": "/api/v1/general/merge-pdfs"
}| Setting | Default | Configuration |
|---|---|---|
| Max file size | 2 GB | SYSTEM_MAX_FILE_SIZE |
| Timeout | 5 min | SYSTEM_CONNECTION_TIMEOUT_MINUTES |
import requests
API_URL = "https://pdf.app.bauer-group.com/api/v1"
API_KEY = "your-api-key"
def merge_pdfs(files, output_path):
response = requests.post(
f"{API_URL}/general/merge-pdfs",
headers={"X-Api-Key": API_KEY},
files=[("fileInput", open(f, "rb")) for f in files]
)
with open(output_path, "wb") as f:
f.write(response.content)
# Usage
merge_pdfs(["doc1.pdf", "doc2.pdf"], "merged.pdf")const FormData = require('form-data');
const fs = require('fs');
const axios = require('axios');
const API_URL = 'https://pdf.app.bauer-group.com/api/v1';
const API_KEY = 'your-api-key';
async function mergePdfs(files, outputPath) {
const form = new FormData();
files.forEach(file => {
form.append('fileInput', fs.createReadStream(file));
});
const response = await axios.post(
`${API_URL}/general/merge-pdfs`,
form,
{
headers: {
'X-Api-Key': API_KEY,
...form.getHeaders()
},
responseType: 'arraybuffer'
}
);
fs.writeFileSync(outputPath, response.data);
}
// Usage
mergePdfs(['doc1.pdf', 'doc2.pdf'], 'merged.pdf');$ApiUrl = "https://pdf.app.bauer-group.com/api/v1"
$ApiKey = "your-api-key"
function Merge-Pdfs {
param(
[string[]]$Files,
[string]$OutputPath
)
$form = @{}
$Files | ForEach-Object {
$form["fileInput"] = Get-Item $_
}
Invoke-RestMethod `
-Uri "$ApiUrl/general/merge-pdfs" `
-Method Post `
-Headers @{"X-Api-Key" = $ApiKey} `
-Form $form `
-OutFile $OutputPath
}
# Usage
Merge-Pdfs -Files @("doc1.pdf", "doc2.pdf") -OutputPath "merged.pdf"