You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[18.0][FEAT] attachment_preview: add Office format preview via LibreOffice
Extends attachment_preview to support DOCX, XLSX, PPTX, DOC, XLS, PPT,
and ODG in addition to the existing PDF + ODF format support.
New endpoint: GET /attachment_preview/office_to_pdf
Accepts ?model=<model>&field=<field>&id=<id>&filename=<name>
Converts the binary field content to PDF using LibreOffice headless,
then streams the PDF to ViewerJS for in-browser rendering.
Returns HTTP 503 gracefully if LibreOffice is not installed.
Changes:
- controllers/main.py: new HTTP controller with LibreOffice conversion
- utils.esm.js: OFFICE_EXTENSIONS added to canPreview(); getUrl() routes
Office files to the conversion endpoint
- binary_field.esm.js: passes filename for correct extension detection
- tests: controller unit tests covering success, FileNotFoundError,
TimeoutExpired, and non-zero exit code paths
Closes#603
0 commit comments