v0.9.0
DOCX & PPTX Document Preview Engine.
Added
- High-Fidelity In-Browser Office Document & Presentation Preview Engines:
docx-preview.min.js&jszip.min.js: Client-side high-fidelity Word document rendering preserving pagination, margins, typography, tables, drawings, and embedded images.pptx-viewer.umd.js: Client-side high-fidelity PowerPoint presentation rendering preserving slide aspect ratios, background themes, shapes, typography, tables, and slide deck layout.Assets/js/office-viewer.js: Automated controller initializing.fic-docx-containerand.fic-pptx-containerviewers, fetching binary payloads via stream routes, and providing slide navigation controls (Prev, Next, slide counter, tabs, keyboard shortcuts).- Stream route integration in
FileStreamControllerwithdocx,dotx,pptx,potxinINLINE_MIME_TYPESandMAGIC_SIGNATURES.
- OpenXML Word Document (
.docx,.dotx,.doc) Preview Engine:DocxParserService: Pure-PHP memory-safe OpenXML DOM parser extracting headings (H1-H4), formatted text runs (bold, italic, underline, strike, monospace code), bullet/numbered lists, and tables with pre-escaped HTML (htmlspecialchars()).DocxPreviewHandler: Handler for Word documents returning structured HTML and metadata (paragraphCount,headingCount,tableCount,wordCount). Gracefully detects legacy.doc(OLE2 binary format) to emit safe download notices without memory bloat.Template/file/docx_preview.php: Word Document reading pane with summary badges and clean typography.
- OpenXML PowerPoint Presentation (
.pptx,.potx,.ppt) Preview Engine:PptxParserService: Pure-PHP memory-safe presentation parser resolving slide ordering viappt/presentation.xml&ppt/_rels/presentation.xml.rels, extracting slide titles, bullet points, text blocks, and structured slide tables.PptxPreviewHandler: Handler for PowerPoint presentations returning slide deck arrays and metadata (slideCount,title). Gracefully detects legacy.pptformat.Template/file/pptx_preview.php: Interactive presentation viewer with slide switcher tabs (Slide 1,Slide 2...), active slide canvas, and presentation title header.
- Expanded Test Suite:
- 30 new unit and integration tests covering synthetic OpenXML ZIP document & presentation parsing, slide ordering, bullet point extraction, table extraction, legacy format notices, streaming MIME types, and template rendering (total 755 tests, 2562 assertions).
Changed
- Updated
FileValidationServiceto whitelistdocx,dotx,doc(10 MB cap) andpptx,potx,ppt(15 MB cap) with strict MIME mappings. - Updated
PreviewViewModeRegistrywith "Word Document" and "PowerPoint Presentation" labels. - Updated
FilePreviewControllerto registerDocxPreviewHandlerandPptxPreviewHandlerand route todocx_previewandpptx_previewtemplates. - Updated
Template/file/dropdown.phpto include docx and pptx extensions in the Safe Preview menu. - Bumped plugin version to
0.9.0inPlugin.php.