Lightweight, elegant read-only document previewer for Windows (Office, CSV, Markdown)
C#
0
1 commits
updated Sep 24, 2026
DocPreview is an ultra-lightweight, elegant, read-only document previewer for Windows 10 & 11 built with C# (.NET 10) and WPF Fluent Design (Wpf.Ui).
It is designed strictly for instant previewing without the weight, memory consumption, or complexity of full office suites or Chromium/Electron apps.
IPreviewHandler): Queries the Windows Registry for Microsoft Office preview handlers. If Office is installed, it leverages native COM with 100% fidelity and virtually zero memory overhead.DocViewer.exe "path\to\doc.xlsx").| Format | Extension | Rendering Pipeline | Features |
|---|---|---|---|
| Word | .docx, .doc | docx-preview / COM | Full pagination, headers, footers, tables, and images. |
| Excel | .xlsx, .xls | ExcelDataReader / COM | Multi-sheet interactive tabs, cell formatting, and live search. |
| PowerPoint | .pptx, .ppt | Slide Deck Engine / COM | Slide thumbnails, 16:9 canvas viewer, and arrow key navigation. |
| Data | .csv, .tsv | CsvHelper Streaming Table | Sticky headers, row numbers, sortable columns, and instant filter. |
| Markdown | .md, .markdown | Markdig + GitHub Styling | CommonMark/GFM, code blocks, tables, task lists, dark/light themes. |
| Shortcut | Action |
|---|---|
Ctrl + O | Open file dialog |
Ctrl + + / Ctrl + - | Zoom In / Zoom Out |
Ctrl + 0 | Reset Zoom to 100% |
Ctrl + E | Open current file in default system application |
F5 | Reload preview |
Left / Right Arrow | Previous / Next slide (when viewing PowerPoint) |
You can preview documents directly by right-clicking on them in Windows File Explorer:
Option A: One-Click Inside the App
Option B: Run the Included PowerShell Script
powershell -ExecutionPolicy Bypass -File .\register_context_menu.ps1powershell -ExecutionPolicy Bypass -File .\unregister_context_menu.ps1Option C: Command-Line Flags
.\publish\DocViewer.exe --register
.\publish\DocViewer.exe --unregister
dotnet run
dotnet run -- "test_samples\budget.xlsx"
Verifies document parsing and HTML generation for all supported formats:
dotnet run -- --test
dotnet publish -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true -o publish
The resulting publish\DocViewer.exe is ~8.6 MB and ready for immediate deployment.
doc_viewer/
├── Assets/ # Embedded webview scripts (docx-preview, jszip)
├── Controls/
│ └── PreviewHandlerHost.cs # Win32 COM HwndHost for native Windows preview handlers
├── Services/
│ ├── DocumentPreviewService.cs # Master routing & fallback engine
│ ├── RegistryHelper.cs # Registry query for COM CLSIDs
│ ├── MarkdownRenderer.cs # Markdig + GitHub dark/light styling
│ ├── CsvRenderer.cs # Fast streaming CSV with search & sticky headers
│ ├── ExcelRenderer.cs # Multi-sheet .xlsx & legacy .xls reader
│ ├── WordRenderer.cs # Paginated .docx DOM renderer
│ └── PowerPointRenderer.cs # Slide deck presentation viewer
├── test_samples/ # Sample test documents (.docx, .xlsx, .pptx, .csv, .md)
├── MainWindow.xaml / .cs # Fluent UI, Mica backdrop, Drag & Drop
├── App.xaml / .cs # Application startup, encoding, and self-test harness
└── DocViewer.csproj # .NET 10 project definition
1 commits
C#
83.6%
PowerShell
11.0%
Python
5.2%
Lightweight, elegant read-only document previewer for Windows (Office, CSV, Markdown)
C#
0
1 commits
updated Sep 24, 2026
DocPreview is an ultra-lightweight, elegant, read-only document previewer for Windows 10 & 11 built with C# (.NET 10) and WPF Fluent Design (Wpf.Ui).
It is designed strictly for instant previewing without the weight, memory consumption, or complexity of full office suites or Chromium/Electron apps.
IPreviewHandler): Queries the Windows Registry for Microsoft Office preview handlers. If Office is installed, it leverages native COM with 100% fidelity and virtually zero memory overhead.DocViewer.exe "path\to\doc.xlsx").| Format | Extension | Rendering Pipeline | Features |
|---|---|---|---|
| Word | .docx, .doc | docx-preview / COM | Full pagination, headers, footers, tables, and images. |
| Excel | .xlsx, .xls | ExcelDataReader / COM | Multi-sheet interactive tabs, cell formatting, and live search. |
| PowerPoint | .pptx, .ppt | Slide Deck Engine / COM | Slide thumbnails, 16:9 canvas viewer, and arrow key navigation. |
| Data | .csv, .tsv | CsvHelper Streaming Table | Sticky headers, row numbers, sortable columns, and instant filter. |
| Markdown | .md, .markdown | Markdig + GitHub Styling | CommonMark/GFM, code blocks, tables, task lists, dark/light themes. |
| Shortcut | Action |
|---|---|
Ctrl + O | Open file dialog |
Ctrl + + / Ctrl + - | Zoom In / Zoom Out |
Ctrl + 0 | Reset Zoom to 100% |
Ctrl + E | Open current file in default system application |
F5 | Reload preview |
Left / Right Arrow | Previous / Next slide (when viewing PowerPoint) |
You can preview documents directly by right-clicking on them in Windows File Explorer:
Option A: One-Click Inside the App
Option B: Run the Included PowerShell Script
powershell -ExecutionPolicy Bypass -File .\register_context_menu.ps1powershell -ExecutionPolicy Bypass -File .\unregister_context_menu.ps1Option C: Command-Line Flags
.\publish\DocViewer.exe --register
.\publish\DocViewer.exe --unregister
dotnet run
dotnet run -- "test_samples\budget.xlsx"
Verifies document parsing and HTML generation for all supported formats:
dotnet run -- --test
dotnet publish -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true -o publish
The resulting publish\DocViewer.exe is ~8.6 MB and ready for immediate deployment.
doc_viewer/
├── Assets/ # Embedded webview scripts (docx-preview, jszip)
├── Controls/
│ └── PreviewHandlerHost.cs # Win32 COM HwndHost for native Windows preview handlers
├── Services/
│ ├── DocumentPreviewService.cs # Master routing & fallback engine
│ ├── RegistryHelper.cs # Registry query for COM CLSIDs
│ ├── MarkdownRenderer.cs # Markdig + GitHub dark/light styling
│ ├── CsvRenderer.cs # Fast streaming CSV with search & sticky headers
│ ├── ExcelRenderer.cs # Multi-sheet .xlsx & legacy .xls reader
│ ├── WordRenderer.cs # Paginated .docx DOM renderer
│ └── PowerPointRenderer.cs # Slide deck presentation viewer
├── test_samples/ # Sample test documents (.docx, .xlsx, .pptx, .csv, .md)
├── MainWindow.xaml / .cs # Fluent UI, Mica backdrop, Drag & Drop
├── App.xaml / .cs # Application startup, encoding, and self-test harness
└── DocViewer.csproj # .NET 10 project definition
1 commits
C#
83.6%
PowerShell
11.0%
Python
5.2%