Read-only preview for office documents, PDFs, diagrams, presentations, and markup files directly inside VS Code.
Supported Formats
| Format | Extensions | Renderer |
|---|---|---|
| Word | .docx |
docx-preview — text, headings, tables, lists, styles |
| Excel | .xlsx, .xlsm |
SheetJS — all sheets with tab switcher |
| CSV | .csv |
Lightweight table preview with UTF-8 and Shift_JIS decoding |
.pdf |
pdf.js — all pages, high-resolution canvas | |
| PowerPoint | .pptx |
pptx-preview — slides in list view |
| Marp Slides | .marp.md |
Marp Core — スライドプレビュー with navigation |
| Mermaid | .mmd, .mermaid |
Mermaid — flowcharts, sequence diagrams, Gantt, etc. |
| HTML | .html, .htm |
Sandboxed iframe preview |
| Markdown | .md, .markdown |
Rendered markdown with embedded Mermaid diagrams |
All previews are read-only. Files are never modified.
Usage
Opening a .docx, .xlsx, .pdf, .pptx, .mmd, .mermaid, or .marp.md file automatically shows the preview.
For .csv, .html, .htm, .md, and .markdown files (which have built-in VS Code editors), right-click the file → Reopen Editor With… → Office File Preview (...) to switch to the preview.
Marp Slides Preview
Files with the .marp.md extension are automatically opened as slide presentations.
For regular .md files with marp: true in the frontmatter, right-click → Reopen Editor With… → Office File Preview (Marp Slides).
Features:
- Slide-by-slide navigation (← → keys or buttons)
- Zoom controls from 25% to 300% (
+/-or Ctrl/Cmd + mouse wheel) - Fit mode to keep the whole slide visible (
0) - Width mode to fill the available width (
W) - Responsive scaling when the editor panel is resized
- Local relative images and CSS background images resolved from the Markdown file directory
- HTTPS images allowed by the webview content security policy
- All-slides overview mode
- Dark/light theme follows VS Code
- HTML rendering enabled
Mermaid in Markdown
Mermaid code blocks inside .md files are automatically rendered as diagrams. The theme follows VS Code's dark/light mode.
```mermaid
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Do it]
B -->|No| D[Skip]
```
Known Limitations
- pptx rendering faithfulness depends on slide complexity (animations and SmartArt may not render correctly)
- Large PDFs (200+ pages) render all pages at once; initial load may take a moment
- HTML preview uses a sandboxed iframe; resources with absolute external URLs may not load
- Marp slides: custom themes (CSS files) are not yet supported; only built-in themes (default, gaia, uncover)