Convert an office document to PDF
POST/pdf/convert
Converts a Word, Excel, PowerPoint, OpenDocument or RTF file into a PDF render (Starter plan and
above). Upload the file as multipart/form-data, or name the render of a Word or PowerPoint
template (output docx or pptx) as source in a JSON body. Accepted are DOCX, XLSX, PPTX, ODT, ODS, ODP, DOC, XLS, PPT, RTF and HTML, up to 20 MB;
the type is read from the file's content, not its name, so a "save as web page" export that
carries a .doc name converts as the HTML it is. Macro-enabled and password-protected
documents are refused. The file is converted and not kept; the PDF is stored like any render.
HTML is converted by LibreOffice, not by the render engine, and the converter loads nothing
from the web: images and stylesheets the document links to stay empty. For HTML you control, a
render with an html source gives a better result.
Costs follow the PDF rule: one unit per started five pages on live keys. Chain /pdf/protect,
/pdf/watermark or /pdf/merge on the returned render id. Below the Starter plan the answer
is 403 forbidden with feature: office. Needs render:create.
Fonts the document uses but neither embeds nor finds among the converter's fonts are replaced by metric-compatible ones (Carlito for Calibri, Caladea for Cambria, Liberation for Arial and Times New Roman). Embed fonts in Word for an exact result.
Request
Responses
- 200
- 400
- 413
- 415
- 422
- 429
- 503
- default
Converted render.
No file part or an empty one, a body that is neither JSON nor multipart, or a source that is no render id.
File too large.
file_type_unsupported: not an accepted office document, or a macro-enabled one.
source_encrypted (a password-protected document), office_document_invalid, office_conversion_failed; for a source, source_not_found or source_invalid (not a Word or PowerPoint render).
rate_limited: the workspace's bucket of the plan's requests per second is empty (Free test keys also have 30 a minute). The problem names the bucket's limit and its window_seconds. Retry after Retry-After seconds.
Response Headers
Seconds until a request is let through again.
Size of the workspace's request bucket: the plan's requests per second. Free test keys are also held to 30 requests a minute, and the headers then describe whichever bucket is closer to empty.
Requests left in the bucket.
Seconds until the bucket is full again.
office_unavailable: the converter is busy; retry after Retry-After seconds.
Error (RFC 9457 problem details).