feat: Support client-side rendering for PPTX and PPT files#1341
feat: Support client-side rendering for PPTX and PPT files#1341spider-yamet wants to merge 24 commits intoeigent-ai:mainfrom
Conversation
|
Please review my PR, @bytecii , @Wendong-Fan |
…thub.com/spider-yamet/eigent into feat/support-client-side-render-PPTX-PPT
|
@bytecii @Wendong-Fan could you please review this PR? |
|
@bytecii @Wendong-Fan could you please review this PR? |
|
@fengju0213 could you please review this pr? |
|
Thanks @spider-yamet for your contribution and your patience! Sorry for the delayed response — I'll do a detailed code review next and will follow up soon. |
|
Thanks for your response, @4pmtong , I am waiting for review :) |
4pmtong
left a comment
There was a problem hiding this comment.
Hi @spider-yamet, thanks for contributing the PPTX preview feature.
When testing it, I noticed some rendering issues (e.g., black boxes and inconsistent fonts/colors). This is likely due to:
Missing fonts, which can make text appear as black rectangles
Limited support for complex OOXML (themes, gradients, etc.)
Do you think we could look into alternative libraries for better fidelity? A couple of options I came across:
@docmentis/udoc-viewer, pptx-preview.js, @kandiforge/pptx-renderer
Would you be open to evaluating one of these or another similar library? Happy to discuss further.
|
@4pmtong Thanks for your feedback for better fidelity: @docmentis/udoc-viewer — open license, WASM-based engine, optional font loading, client-side, PDF+PPTX+images. And other pptx-preview and @kandiforge/pptx-renderer has some restrictive terms on source and redistribution, so I think we can consider @docmentis/udoc-viewer.. let me know your opinion :) |
|
@spider-yamet |
|
Hi @4pmtong Updated by using @docmentis/udoc-viewer, please check :) |


Related Issue
Closes #1339
Description
This PR adds client-side rendering for PPTX (and PPT) files in the Agent Folder, as requested in #1339.
What changed:
getFileAsDataUrl(path, type?)(inFileReader) so the renderer receives raw PPTX bytes as a data URL. Remote URLs are downloaded to a temp path first, then read and returned as a data URL.get-file-dataurlhandler andgetFileAsDataUrlonelectronAPI; preload andelectron.d.tsupdated.PptxViewercomponent (lazy-loaded) that decodes the data URL, parses the PPTX in the renderer with JSZip and the browser’s DOMParser, and renders slides with a filmstrip and prev/next controls.get-file-dataurlinstead ofopen-file; content area showsPptxViewerwhen content is a data URL. If IPC is unavailable (e.g. browser-only), a short message explains that PPTX preview is available in the desktop app.jszipfor browser-safe PPTX unzip in the renderer.Why: Preview was previously done in the main process (text-only HTML). Moving to client-side rendering matches the PDF pattern (raw bytes → renderer), supports remote files via the same path, and allows a proper slide-by-slide UI. Legacy
.pptis out of scope for this change.Testing Evidence (REQUIRED)
Contribution Guidelines Acknowledgement