DOCX Viewer

pending

by Gokul & Claude

View .docx files natively; opens in new tab with high-fidelity rendering, pinch-to-zoom, in-document search, auto light/dark theme switch, markdown conversion.

1 starsUpdated 14d agoMITDiscovered via Obsidian Unofficial Plugins
View on GitHub

Obsidian DOCX Viewer

View .docx files directly inside Obsidian — in a native tab, just like PDFs.

Features

FeatureDetails
📄 Native tab viewerOpens .docx in a new tab, same as PDF
🔗 Wikilink support[[My Document.docx]] opens the viewer
🔍 In-document searchHighlight + navigate all matches
🔎 Zoom50%–200%, reset button
🖨 PrintPrint-optimized output
→ Convert to NoteConverts to .md alongside the docx

Installation

Option A — Manual (recommended for development)

  1. Build the plugin (see Development below)
  2. Copy the plugin folder into your vault:
    <YourVault>/.obsidian/plugins/obsidian-docx-viewer/
    ├── main.js
    ├── manifest.json
    └── styles.css
    
  3. In Obsidian: Settings → Community Plugins → Installed Plugins → Enable "DOCX Viewer"

Option B — BRAT (Beta Reviewers Auto-update Tool)

  1. Install the BRAT plugin from Community Plugins
  2. Add this repo via BRAT: BRAT → Add Beta Plugin

Development

Prerequisites

  • Node.js 18+
  • npm 9+

Setup

git clone <this-repo>
cd obsidian-docx-viewer
npm install
npm run build

This produces main.js in the project root. Copy main.js, manifest.json, and styles.css into your vault's plugin folder.

For live development with auto-rebuild:

npm run dev

Project Structure

src/
  main.ts        ← Plugin entry point, registers view + file handlers
  DocxView.ts    ← The viewer tab (ItemView subclass)
  converter.ts   ← DOCX → Markdown conversion (mammoth.js)
styles.css       ← All viewer + toolbar styles
manifest.json    ← Obsidian plugin manifest

How It Works

  • Rendering: Uses docx-preview for high-fidelity rendering (tables, images, fonts, headers, footers).
  • Conversion: Uses mammoth.js to convert DOCX → clean Markdown for the "Convert to Note" feature.
  • Zoom: CSS transform: scale() on the rendered document container.
  • Search: DOM TreeWalker to find text nodes, wraps matches in <mark> elements, scrolls to current match.
  • Print: Opens a new window with the rendered HTML + copied stylesheets.

Roadmap (v2)

  • Edit and save back to .docx
  • Tracked changes display toggle
  • Page navigation (jump to page N)
  • Thumbnail sidebar
  • Annotation / highlight support

Compatibility

  • Desktop only (Obsidian mobile does not support Node.js file APIs)
  • Obsidian 1.0.0+

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.