---
title: "Preview Pptx As Pdf"
method: GET
path: "/api/files/preview-pdf/{file_id}"
tags: ["files"]
---

# Preview Pptx As Pdf

`GET /api/files/preview-pdf/{file_id}`

Return a PDF rendering of a .pptx for high-fidelity in-browser preview.

The frontend hits this endpoint first; if it succeeds it shows the PDF
in an ``<iframe>`` (vector, text-selectable, perfect font metrics).
On a 503 response — meaning the server doesn't have LibreOffice on
PATH — the frontend falls back to the existing ``pptxviewjs`` canvas
renderer so the UX still works on developer machines without soffice
installed.

Mirrors the durable-storage restore path that ``/preview`` uses: for
files whose local copy was reaped but whose ``storage_key`` is still in
durable storage, we materialize before conversion (returning 409 on
checksum mismatch, 503 on durable backend failure — same semantics as
``/preview``). Without this, durable-only ``.pptx`` files would 404 here
and silently fall back to the canvas renderer, which is exactly the
UX regression flagged in PR #542 review.

## Path parameters

- `file_id` string, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/xorbitsai/apis/xagent.md) · [All operations](https://skmtc.net/xorbitsai/apis/xagent/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xorbitsai/xagent/revisions/33e4ba4936ad/schema)
