DocDown is a family of .NET libraries and a command-line tool that extract useful information from documents (PDF, Word, Excel, PowerPoint, Visio) into a scratch folder, in a predictable layout designed to be fed to multimodal AI agents. It reports what was read, what was counted, and any plain-language notes about steps that could not be completed; it does not judge whether document content is acceptable.
- π Many Formats - PDF, Word, Excel, PowerPoint, and Visio
- π¦ Invariant Output Layout -
summary.txt,manifest.json,metadata.json,content.md,images/, andpages/for every document - πΌοΈ Page Images - Optional fully managed rendering of PDF pages, slides, and Visio pages
- π¬ Review Comments -
review-comments.mdwritten when the document carries reviewer comments - π Honest Reporting - Anything that could not be extracted is reported with a reason, never silently omitted
- π§© Pluggable Backends - Explicit, reflection-free registration; write your own backend on the Core abstractions
- π Cross-Platform - Fully managed libraries for .NET 8, 9, and 10; the tool runs on .NET 10
- β Self-Validation - Built-in qualification tests for regulated environments
Install one format package per format you read; each brings DemaConsulting.DocDown.Core with it.
dotnet add package DemaConsulting.DocDown.Pdf # .pdf
dotnet add package DemaConsulting.DocDown.Office # .docx, .xlsx, .pptx, .vsdx, .vsdmPage images come from optional add-on packages: DemaConsulting.DocDown.Pdf.Rendering,
DemaConsulting.DocDown.PowerPoint.Rendering, and DemaConsulting.DocDown.Visio.Rendering.
Requires the .NET 10 SDK or runtime.
dotnet tool install --global DemaConsulting.DocDown.Tool
docdown --versionOr install into a local tool manifest so the version travels with the repository:
dotnet new tool-manifest # if you don't have a tool manifest already
dotnet tool install DemaConsulting.DocDown.Tool
dotnet docdown --versiondocdown --input report.pdf --scratch ./outThe last line of output is the absolute path to the produced summary.txt, ready to hand to an
agent. The tool exits 0 when the output layout was written (even if notes were recorded) and 1
when the document was unreadable or an argument was bad. Run docdown --help for all options, and
docdown --validate to run self-validation.
using System;
using System.Threading;
using DemaConsulting.DocDown.Core;
using DemaConsulting.DocDown.Word;
var engine = new DocDownBuilder()
.AddWord()
.Build();
var result = await engine.ExtractAsync(
documentPath: "contracts/sample-agreement.docx",
scratchFolder: "scratch/sample-agreement",
options: null,
cancellationToken: CancellationToken.None);
if (result.Outcome == ExtractionOutcome.Unreadable)
{
Console.Error.WriteLine(result.Failure?.Explanation);
return 1;
}
Console.WriteLine(result.SummaryPath);
return 0;out/
βββ summary.txt # what was extracted and where - paste this into the model context window
βββ manifest.json # machine-readable twin of summary.txt
βββ metadata.json # what the document asserts about itself, with provenance
βββ content.md # textual content as markdown, linking into images/
βββ review-comments.md # reviewer comments - only when the document has any
βββ images/ # extracted embedded images
βββ pages/ # rendered page images, when requested and available
The DocDown User Guide, covering every format, the output contract, backend selection, and the tool options, is available on the DocDown releases page.
Contributions are welcome! Please see our Contributing Guide for development setup, coding standards, and submission guidelines. Also review our Code of Conduct.
For bug reports, feature requests, and questions, please use GitHub Issues.
This project is licensed under the MIT License β see the LICENSE file for details.
- π Report Bugs: GitHub Issues
- π‘ Request Features: GitHub Issues
- π€ Contributing: Contributing Guide
- π Linting Enforcement - markdownlint, cspell, and yamllint enforced on every CI run
- π Continuous Compliance - Compliance evidence generated automatically on every CI run, following the Continuous Compliance methodology
- βοΈ SonarCloud Integration - Quality gate and security analysis on every build
- π Requirements Traceability - Requirements linked to passing tests with auto-generated trace matrix
For security concerns and vulnerability reporting, please see our Security Policy.
DocDown is built with the following open-source projects:
- .NET - Cross-platform framework for building applications
- DocumentFormat.OpenXml - Office Open XML parsing
- PdfPig - Managed PDF parsing
- CanvasNet - Managed page rendering
- DemaConsulting.TestResults - TRX and JUnit XML test results library