docboss.dev

Compare

docboss vs antiword and catdoc.

antiword and catdoc are C command-line tools that extract text from legacy .doc files. docboss reads the same files into a full document model: about 19 times faster on the benchmark sample, with higher word recall and text from more damaged files. The C tools use less memory and win on one very large file; both tables are below.

At a glance, legacy .doc files
docbossantiwordcatdoc
EngineSafe Rust, no C dependenciesCC
Text, 80 sampled files3,130 files/s158 files/s161 files/s
Word recall (mean)0.9850.9480.888
Parallel, 12 workers5,685 files/s392 files/s490 files/s
One 1,188-page document105 ms2,552 ms54 ms
Peak memory, 100 files40.4 MB23.8 MB (child 2.5)23.3 MB (child 2.0)
150 damaged DOC filesText from 142, no crash or hangText from 71, 3 crashesText from 100, 1 hang
OutputText, Markdown, HTML, JSON, pages, DOCXTextText

antiword 0.37 and catdoc 0.95, built from source and measured by the docboss benchmark harness. antiword refuses 12 of the 78 sampled files the others open; the speed rows count only the 66 every engine handled.

Migration

From text dump to document.

docboss text gives one line per paragraph with list labels and tab-separated table rows. The same file also converts to Markdown, HTML or DOCX.

before
$ antiword legacy.doc > legacy.txt
$ catdoc legacy.doc > legacy.txt
after
$ docboss text legacy.doc -o legacy.txt
$ docboss md legacy.doc                    # Markdown with tables and lists
$ docboss convert legacy.doc -o legacy.docx
$ docboss text locked.doc --password secret

Where they are ahead

Where antiword and catdoc win.

  • Memory: about 24 MB for the whole process with 2 to 3 MB of their own, against docboss's 40.4 MB, because they never build a document model.
  • One very large document: catdoc reads the 1,188-page DOC in 54 ms, about 2 times faster than docboss's 105 ms.

Where docboss is ahead

What docboss adds.

  • About 19 times the speed on the sample, and 5,685 files per second through extract_texts on 12 cores.
  • Recall: on Bug50955.doc, a 74,813-word Russian novel, antiword and catdoc decode 0.1% of the words and docboss all of them.
  • Damaged files: text from 142 of 150, with no crash and no hang.
  • Formatting, tables, lists, notes, comments, pictures and page rendering, and DOCX files through the same calls.

Questions

Which Word versions does docboss read?
Word 97-2003 files with their formatting, lists, tables, sections, notes, comments, fields, bookmarks and pictures; Word 6 and 95 files with their formatting, sections, headers, footers, tables, pictures and numbered paragraphs, and Word 2 files as text only. Word 6 and 95 comments, endnotes, drawing objects and equations are left out and reported.
Is docboss faster than antiword and catdoc?
On the benchmark's 80 sampled DOC files, yes: 3,130 files per second against catdoc's 161 and antiword's 158, about 19 times. On one generated 1,188-page document catdoc is faster, 54 ms against docboss's 105 ms, because it streams text out of the piece table without building a document model.
Does docboss use more memory?
Yes. antiword and catdoc stream text in about 2 to 3 MB of their own; docboss holds the whole document model and peaks at 40.4 MB over 100 files and 63.5 MB on a 6.24 MB file whose pictures take 12 MB of it.
Can it open encrypted .doc files?
Yes: RC4, RC4 CryptoAPI and XOR obfuscation, with the password given. Password-protected Word 6 and 95 files are refused with an error.