v4

latestOpenAPI 3.1.0raw.githubusercontent.com2026-06-13216144508.7 KB
files

Preview Pptx As Pdf

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.

get/api/files/preview-pdf/{file_id}

Path parameters

file_idstring required

Response

Successful Response

{"stackTrail":"paths:/api/files/preview-pdf/{file_id}:get:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}