LeaflyPDF API
250 jobb/månad gratis, därefter från 0,005 €/jobb · REST + webhooks · SDK:er
OpenAPI reference · openapi.json · API-nycklar
1. Create a job
curl -X POST https://api.leaflypdf.com/v1/jobs \
-H "Authorization: Bearer $LEAFLYPDF_KEY" \
-F tool=compress \
-F 'options={"preset":"recommended"}' \
-F file=@input.pdf2. Poll or receive a webhook
curl https://api.leaflypdf.com/v1/jobs/$JOB_ID -H "Authorization: Bearer $LEAFLYPDF_KEY" # webhook: POST with header LeaflyPDF-Signature: t=<ts>,v1=<hmac-sha256(secret, "<ts>.<body>")>
3. Download
curl -o out.pdf https://api.leaflypdf.com/v1/jobs/$JOB_ID/outputs/0 -H "Authorization: Bearer $LEAFLYPDF_KEY"
SDKs
npm i @pdfworks/sdk
import { PdfWorks } from '@pdfworks/sdk';
const pw = new PdfWorks({ apiKey: process.env.LEAFLYPDF_KEY });
const [out] = await pw.run('merge', [a, b]);
pip install pdfworks
from pdfworks import PdfWorks
PdfWorks(api_key=KEY).run("ocr", ["scan.pdf"], {"langs": ["deu"]})Tools (68)
| id | Verktyg | engine |
|---|---|---|
| merge | Sammanfoga PDF | local |
| split | Dela PDF | local |
| remove-pages | Ta bort sidor | local |
| extract-pages | Extrahera sidor | local |
| organize | Organisera PDF | local |
| rotate | Rotera PDF | local |
| remove-blank-pages | Ta bort tomma sidor | local |
| insert-blank | Infoga tom sida | local |
| alternate-mix | Varva och blanda | local |
| split-half | Dela sidor på mitten | local |
| n-up | Flera sidor per ark | local |
| scan | Skanna till PDF | local |
| compress | Komprimera PDF | local |
| repair | Reparera PDF | local |
| ocr | OCR PDF | hybrid |
| deskew | Räta upp | local |
| grayscale | PDF i gråskala | local |
| linearize | Webboptimera | local |
| flatten | Platta till PDF | local |
| images-to-pdf | JPG till PDF | local |
| word-to-pdf | Word till PDF | server |
| excel-to-pdf | Excel till PDF | server |
| powerpoint-to-pdf | PowerPoint till PDF | server |
| html-to-pdf | HTML till PDF | server |
| text-to-pdf | Text till PDF | local |
| epub-to-pdf | EPUB till PDF | server |
| pdf-to-images | PDF till JPG | local |
| extract-images | Extrahera bilder | local |
| pdf-to-word | PDF till Word | local |
| pdf-to-excel | PDF till Excel | local |
| pdf-to-powerpoint | PDF till PowerPoint | local |
| pdf-to-pdfa | PDF till PDF/A | local |
| pdf-to-text | PDF till text | local |
| pdf-to-markdown | PDF till Markdown | local |
| attachments | Extrahera bilagor | local |
| edit | Redigera PDF | local |
| edit-text | Redigera text | local |
| page-numbers | Sidnummer | local |
| header-footer | Sidhuvud och sidfot | local |
| watermark | Vattenstämpel | local |
| overlay | Lägg över PDF | local |
| bates | Bates-numrering | local |
| crop | Beskär PDF | local |
| resize | Ändra sidstorlek | local |
| flip | Vänd sidor | local |
| metadata | Redigera metadata | local |
| bookmarks | Redigera bokmärken | local |
| fill-form | Fyll i PDF-formulär | local |
| create-form | Skapa formulär | local |
| protect | Skydda PDF | local |
| unlock | Lås upp PDF | local |
| sign | Signera PDF | local |
| request-signatures | Begär signaturer | server |
| redact | Maskera PDF | local |
| compare | Jämför PDF | local |
| chat | Chatta med PDF | server |
| summarize | AI-sammanfattning | server |
| translate | Översätt PDF | server |
| questions | Frågegenerator | server |
| extract-data | Extrahera data | server |
| smart-rename | Smart namnbyte | server |
| smart-split | Smart delning | server |
| smart-redact | AI-maskering | server |
| einvoice | E-fakturavisare | local |
| create-zugferd | Skapa ZUGFeRD | local |
| accessibility | Tillgänglighetskontroll | local |
| alt-text | Förslag på alternativtext | server |
| inspect | PDF-info | local |