@file-viewer/doc is the open-source legacy MS-DOC (.doc) parser and HTML renderer used by File Viewer. It is extracted from the public msdoc-viewer@0.2.0 line and maintained as the docjs source package.
npm install @file-viewer/docHistorical imports from msdoc-viewer remain supported through the compatibility alias package.
import { parseMsDoc, renderMsDoc } from '@file-viewer/doc'
const parsed = parseMsDoc(arrayBuffer)
const rendered = renderMsDoc(parsed)
container.innerHTML = `<style>${rendered.css}</style><div class="msdoc-root">${rendered.html}</div>`The package also exports parseMsDocToHtml, mountMsDoc, createMsDocViewer, and MsDocWorkerClient.
- OLE/CFB container parsing
- WordDocument, 0Table/1Table, CLX, FKP, CHPX, PAPX, STSH, and font table parsing
- Paragraph, character, table, image, OLE attachment, and basic field-code output
- Browser-native HTML/CSS rendering without server-side conversion
- Optional module worker entry at
@file-viewer/doc/worker
This package intentionally tracks the old public msdoc-viewer@0.2.0 code line. Newer private document-engine work is not used here.