Docs/APIs/Office to PDF

Office to PDF

Convert Word, Excel and PowerPoint files to PDF

OperationalCredits 30 per callp50 2112msDocumentsStar

Overview

Documents are converted with LibreOffice, so fonts, tables, images and page layout are kept as closely as an office suite would print them. The file's extension is checked against its contents, and a file that turns out to be another office format is converted as what it really is. Each call accepts one document up to 10 MB. Password-protected documents are not supported.

Live Test Office to PDF API →

Endpoint

One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.

POSThttps://api.apiverve.com/v1/officetopdf
curl -X POST https://api.apiverve.com/v1/officetopdf \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
  "document": "https://raw.githubusercontent.com/apache/poi/trunk/test-data/document/SampleDoc.docx"
}'

Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.

Authentication

Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.

401 is the only auth verdict

A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.

Parameters

Sent as JSON in the request body. Premium parameters are accepted on every plan but only take effect on plans that include them.

ParameterTypeDescription
documentOptionalstringThe document to convert (up to 10 MB): doc, docx, xls, xlsx, ppt, pptx, odt, ods, odp, rtf, txt or csv, or a public URL to one
pageRangesOptionalPremiumstringPages to convert, such as 1-3,5. Converts the whole document when omitted
length 0–100
landscapeOptionalPremiumbooleanLay the pages out in landscape orientation

Response

Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.

Sample response
{
  "status": "ok",
  "error": null,
  "data": {
    "pdfName": "8f3c2a51-6d0e-4b7a-9c1f-2e5d7a9b4c10.pdf",
    "inputName": "SampleDoc.docx",
    "inputFormat": "docx",
    "pageCount": 2,
    "landscape": false,
    "pageRanges": null,
    "size": 23654,
    "expires": 1792400000000,
    "downloadURL": "https://storage.googleapis.com/apiverve/APIData/officetopdf/8f3c2a51-6d0e-4b7a-9c1f-2e5d7a9b4c10.pdf?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1792400000&Signature=SA…"
  }
}

Response fields

Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.

FieldTypeExampleDescription
pdfNamestring"8f3c2a51-6d0e-4b7a-9c1f-2e5d7a9b4c10.pdf"File name of the PDF
inputNamestring"SampleDoc.docx"File name of the input document
inputFormatstring"docx"Format the document was converted as, detected from its contents (docx, xlsx, pptx...)
pageCountnumber2Pages in the PDF
landscapebooleanfalseWhether landscape orientation was applied
pageRangesobjectnullThe pages converted, or null for the whole document
sizenumber23654Size of the PDF in bytes
expiresnumber1792400000000When the download link expires (Unix time in milliseconds)
downloadURLstring"https://storage.googleapis.com/apiverve/APIData/officetopdf/8f3c2a51-6d0e-4b7a-9c1f-2e5d7a9b4c10.pdf…"Signed link to download the PDF, valid for 2 days

Errors

Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.

StatusMeaningWhat to do
400Input was rejectedRead error; it names the parameter.
401Key missing or invalidCheck the header name and the key value.
403Key valid, but not permittedA key restriction or IP allow-list; see key scoping.
429Rate limited, or out of creditsRead error to tell them apart; see rate limits.

Use cases

Document Archiving
Store contracts, letters and reports as PDFs so they open the same way everywhere, years later.
Invoice and Quote Delivery
Turn invoices or quotes generated as Word or Excel files into PDFs before emailing them to customers.
Upload Normalization
Accept any office file from users and keep a single PDF copy for previews and downstream processing.
Print Preparation
Convert slide decks and spreadsheets to fixed-layout PDFs for printing or sharing.

Other ways to use Office to PDF

Set up Office to PDF on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.

Give it to an AI agentConnect over MCP and your agent calls it as a native tool — Claude, Cursor, ChatGPT.VerveKit →Reference →

More in Documents:

Was this page helpful?