> For the complete documentation index, see [llms.txt](https://docs.mioffice.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mioffice.ai/pdf.md).

# PDF

## Process PDF files

> Merge, split, compress PDFs or convert DOCX/XLSX to PDF. Returns processed file or queues job for async processing.

```json
{"openapi":"3.0.3","info":{"title":"MiOffice API","version":"1.0.0"},"servers":[{"url":"https://mioffice.ai","description":"Production"}],"paths":{"/api/pdf-process":{"post":{"operationId":"processPdf","summary":"Process PDF files","description":"Merge, split, compress PDFs or convert DOCX/XLSX to PDF. Returns processed file or queues job for async processing.","tags":["PDF"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["merge","split","compress","docToPdf","xlsxToPdf"],"description":"PDF operation to perform"},"file":{"type":"string","format":"binary","description":"Single file for split/compress/convert operations"},"file_0":{"type":"string","format":"binary","description":"First file for merge (supports file_0 through file_99)"},"file_1":{"type":"string","format":"binary","description":"Second file for merge"},"options":{"type":"string","description":"JSON string with action-specific options. Split: {\"pages\": \"1,2,5-10\"}"}}}}}},"responses":{"200":{"description":"Processed PDF file","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}},"headers":{"X-Processing":{"schema":{"type":"string"}}}},"202":{"description":"Job queued for async processing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueuedJob"}}}},"400":{"description":"Invalid action, missing files, or validation error"},"413":{"description":"Total file size exceeds 100MB limit"},"429":{"description":"Rate limit exceeded or queue full"}}}}},"components":{"schemas":{"QueuedJob":{"type":"object","properties":{"jobId":{"type":"string","description":"Unique job identifier"},"jobToken":{"type":"string","description":"Authorization token for this job"},"position":{"type":"integer","description":"Current position in queue"},"estimatedWaitMs":{"type":"integer","description":"Estimated wait time in milliseconds"},"pollUrl":{"type":"string","description":"URL to poll for job status"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mioffice.ai/pdf.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
