Skip to content

Convert documents

POST
/v1/convert
curl -H "X-Api-Key: $KEY" -F files=@report.docx \
http://localhost:9027/v1/convert -o report.pdf

Converts uploads and runs any post-processing fields. HTML goes to Fulgur unless htmlEngine says libreoffice; everything else to LibreOffice. Several files come back as a ZIP, or as one PDF with merge=true.

Media typemultipart/form-data

The multipart form /v1/convert and /v1/pdf/convert accept. LibreOffice options (landscape, nativePageRanges, exportFormFields, singlePageSheets, password, …) and post-processing fields (merge, splitMode, watermarkSource, stampSource, rotateAngle, flatten, metadata, bookmarks, embeds, facturxXml, userPassword, …) are accepted as well.

object
assets

Images (PNG, JPEG, GIF, SVG), stylesheets and fonts an HTML page names by file name, as in <img src="logo.png">. Every stylesheet applies to the whole page. Nothing is fetched from anywhere else.

Array<string>
files
required

One or more documents.

Array<string>
htmlEngine

What turns HTML into PDF: fulgur (default), a layout engine with no browser and no network, or libreoffice.

string | null

Example

fulgur
landscape
boolean | null
merge

Merge several inputs into one PDF instead of returning a ZIP.

boolean | null
nativePageRanges
string | null

Example

1-3,5
outputFilename
string | null
password

Opens a protected input.

string | null
pdfa

PDF/A level: PDF/A-1b, PDF/A-2b, PDF/A-3b, PDF/A-4.

string | null
pdfua

Export as PDF/UA.

boolean | null
to

Output format. Default pdf.

string | null

The converted file, or a ZIP of them

Media typeapplication/octet-stream

The file, as bytes.

string format: binary

Accepted; the result goes to the webhook

The request is wrong

Media typeapplication/json

The JSON body of every error response.

object
error
required

A stable, machine-readable kind.

string
message
required

What went wrong, for a person.

string

Example

{
"error": "invalid_request",
"message": "unknown step 'teleport'"
}

An engine is unavailable or the request timed out

Media typeapplication/json

The JSON body of every error response.

object
error
required

A stable, machine-readable kind.

string
message
required

What went wrong, for a person.

string

Example

{
"error": "invalid_request",
"message": "unknown step 'teleport'"
}