BATDOC(1)

NAME
batdoc - cat(1) for doc, docx, xls, xlsx, pptx, and pdf — renders to markdown with bat

SYNOPSIS
batdoc [FLAGS] [FILE...]

FLAGS

-p, --plain
    Force plain text output (no colors, no decorations).

-m, --markdown
    Output as markdown (default when terminal detected).

-i, --images
    Embed images as inline base64 data URIs in markdown output. Extracts embedded images from .docx, .pptx, and .xlsx files. Most useful when piping to a file (batdoc --images report.docx > out.md). Ignored in plain text mode and for formats without image support (.doc, .xls, .pdf).

-h, --help
    Show help information.

DESCRIPTION
batdoc reads Office documents and PDFs and dumps their contents to the terminal as markdown. It is a spiritual successor to catdoc(1) — cat had catdoc, bat gets batdoc. Format is detected by magic bytes (file signature), not file extension. Supported formats: .doc (OLE2 Word 97+), .docx (OOXML), .xls (BIFF8 Excel 97+), .xlsx (OOXML), .pptx (OOXML), and .pdf. When stdout is a terminal, output is pretty-printed as syntax-highlighted markdown via bat(1) with paging. When piped, plain text is emitted. Multiple files can be specified and will be processed in order. Use - to read from stdin explicitly. Maximum input size is 256 MiB.

ENVIRONMENT
batdoc respects the NO_COLOR environment variable. When set, colored output is suppressed even on a terminal. The PAGER environment variable controls which pager is used when output is displayed on a terminal.

SEE ALSO
bat(1), catdoc(1), pdftotext(1)

EXIT STATUS

0   Successful program execution.

1   Unsuccessful program execution.

101 The program panicked.

EXAMPLES

View a Word document in the terminal
    $ batdoc report.docx

Extract a spreadsheet as plain-text TSV
    $ batdoc --plain data.xlsx > data.tsv

Convert a presentation to markdown with embedded images
    $ batdoc --images slides.pptx > slides.md

Read from stdin
    $ curl -sL https://example.com/file.docx | batdoc

AUTHOR

    Damon Petta <d@disassemble.net>