FieldCure.DocumentParsers 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FieldCure.DocumentParsers --version 1.1.0
                    
NuGet\Install-Package FieldCure.DocumentParsers -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FieldCure.DocumentParsers" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FieldCure.DocumentParsers" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="FieldCure.DocumentParsers" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FieldCure.DocumentParsers --version 1.1.0
                    
#r "nuget: FieldCure.DocumentParsers, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FieldCure.DocumentParsers@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FieldCure.DocumentParsers&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=FieldCure.DocumentParsers&version=1.1.0
                    
Install as a Cake Tool

FieldCure.DocumentParsers

Lightweight document text extraction for .NET — DOCX, HWPX, XLSX, PPTX, HTML, and more. Structured Markdown output for LLM / RAG consumption.

Features

  • DOCX — Headings, paragraphs, tables (nested), math → LaTeX, metadata → YAML, footnotes, endnotes, comments, headers/footers
  • HWPX — Korean standard (KS X 6101 / OWPML). Headings, paragraphs, tables, math → LaTeX, metadata → YAML, footnotes, endnotes, memos, headers/footers
  • XLSX — Sheets as markdown tables, metadata → YAML
  • PPTX — Slide text, tables, speaker notes, metadata → YAML
  • HTML — Readable content extraction via SmartReader → GitHub-flavored Markdown via ReverseMarkdown
  • Math equations — DOCX (m:oMath) and HWPX (hp:equation) converted to [math: LaTeX]
  • Metadata — YAML front matter (title, author, created, modified, subject, keywords, description)
  • Footnotes / Endnotes[^N] / [^enN] inline references with definition sections
  • Comments — Inline blockquote > **[Comment — author]:** format
  • Factory patternDocumentParserFactory.GetParser(".docx") returns the right parser
  • Zero platform dependency — Targets net8.0, no Windows-specific APIs
  • Extensible — Implement IDocumentParser and call DocumentParserFactory.Register()

Install

dotnet add package FieldCure.DocumentParsers

Quick Start

using FieldCure.DocumentParsers;

// Auto-detect parser by extension
var parser = DocumentParserFactory.GetParser(".docx");
if (parser is not null)
{
    var bytes = File.ReadAllBytes("report.docx");
    var text = parser.ExtractText(bytes);
    Console.WriteLine(text);
}

// Check all supported extensions
foreach (var ext in DocumentParserFactory.SupportedExtensions)
    Console.WriteLine(ext);  // .docx, .hwpx, .xlsx, .pptx, .html, .htm

// Opt-out control for metadata, footnotes, etc.
var docxParser = new DocxParser();
var options = new ExtractionOptions
{
    IncludeMetadata = false,
    IncludeFootnotes = false
};
var text = docxParser.ExtractText(bytes, options);

Output Format

Headings are prefixed with # markers. Tables are rendered as markdown. Documents with metadata include YAML front matter; footnotes/endnotes are rendered as reference-style links:

---
title: 2026 Business Plan
author: Alice
created: 2026-04-01
---

> **[Header]:** Company Confidential

# 2026 Business Plan

Please refer to the table below[^1] for details.

| Category | Q1 | Q2 |
| --- | --- | --- |
| Revenue | 100 | 150 |
| Cost | 80 | 90 |

> **[Footer]:** Page 1

## Footnotes

[^1]: Source: internal finance report.

Pipe characters inside cells are escaped as \| to preserve table structure. Use ExtractionOptions to selectively disable metadata, footnotes, comments, or headers/footers.

Supported Formats

Format Extension Parser Description
Word .docx DocxParser OpenXML (Office 2007+)
Hangul .hwpx HwpxParser OWPML (Hancom Office)
Excel .xlsx XlsxParser OpenXML spreadsheets
PowerPoint .pptx PptxParser OpenXML presentations
HTML .html, .htm HtmlParser SmartReader + ReverseMarkdown

PDF Support

PDF requires native libraries (PDFium). Install the separate package:

dotnet add package FieldCure.DocumentParsers.Pdf
using FieldCure.DocumentParsers.Pdf;

// Register PDF support (call once at startup)
DocumentParserFactoryExtensions.AddPdfSupport();

See FieldCure.DocumentParsers.Pdf for details.

License

MIT — Copyright (c) 2026 FieldCure Co., Ltd.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on FieldCure.DocumentParsers:

Package Downloads
FieldCure.Ai.Providers

AI provider clients for Claude, OpenAI, Gemini, Ollama, and Groq. Shared models and streaming support.

FieldCure.DocumentParsers.Audio

Audio transcription parser for FieldCure.DocumentParsers. Converts MP3, WAV, M4A, OGG, FLAC, and WebM audio into timestamped Markdown transcripts via Whisper.net.

FieldCure.DocumentParsers.Pdf

PDF text extraction and page image rendering for FieldCure.DocumentParsers

FieldCure.DocumentParsers.Imaging

PDF page image rendering for FieldCure.DocumentParsers via PDFtoImage (PDFium). Adds IMediaDocumentParser capability to the core PDF parser.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 702 4/26/2026
2.0.0 438 4/20/2026
1.1.0 377 4/7/2026
1.0.0 144 4/6/2026
0.4.0 133 4/2/2026
0.3.0 297 3/27/2026
0.2.0 114 3/26/2026
0.1.0 153 3/22/2026

# Release Notes — FieldCure.DocumentParsers

## [1.1.0] - 2026-04-07

### Added
- `HtmlParser` — HTML/HTM text extraction via SmartReader (content extraction) + ReverseMarkdown (HTML → Markdown conversion)
- **Metadata** — YAML front matter output (`title`, `author`, `created`, `modified`, `subject`, `keywords`, `description`) for DOCX, HWPX, PPTX, XLSX
- **Footnotes / Endnotes** — inline `[^N]` / `[^enN]` references with `## Footnotes` / `## Endnotes` definition sections (DOCX, HWPX)
- **Comments / Memos** — inline blockquote `> **[Comment — author]:**` format (DOCX comments, HWPX memos)
- **Headers / Footers** — blockquote `> **[Header]:**` / `> **[Footer]:**` with first-page/even-page variants (DOCX, HWPX)
- `ExtractionOptions` class — opt-out control for metadata, headers, footers, footnotes, endnotes, comments
- `MetadataFormatter` internal utility — `PackageProperties` / Dublin Core → YAML front matter
- `FootnoteCollector` internal utility — footnote/endnote collection and markdown rendering

### Changed
- HWPX element names corrected to camelCase (`footNote`, `endNote`) matching actual Hancom Office output
- HWPX memo detection changed from `hp:memo` to `hp:fieldBegin[type="MEMO"]` with Author/CreateDateTime parameter extraction
- HWPX parser now processes `hp:ctrl` wrappers recursively
- All HWPX element name comparisons are now case-insensitive (`StringComparison.OrdinalIgnoreCase`)
- Footnote/endnote/memo inner text excluded from body output via triple-layer exclusion filter
- Test count increased from 70 to 149 (79 new tests including 21 real-file integration tests)

## [1.0.0] - 2026-04-06

### Added
- `XlsxParser` unit tests — 9 tests covering two-sheet extraction, markdown table output
- `PptxParser` unit tests — 11 tests covering three-slide extraction, slide headers, table output

### Changed
- `OoxmlMathConverter` and `HancomMathNormalizer` are now `internal` (previously `public`) — these are implementation details not intended for direct consumption
- Test count increased from 48 to 70

### Note
This is the first stable release. Public API surface is now committed:
`IDocumentParser`, `IMediaDocumentParser`, `DocumentImage`, `DocumentParserFactory`, and all five parser classes (`DocxParser`, `HwpxParser`, `XlsxParser`, `PptxParser`, `PdfParser`).

## [0.4.0] - 2026-04-02

### Added
- `HwpxParser` heading detection — parses `header.xml` outline levels via paraPr/style chains, outputs `#`–`#######` Markdown headings
- `DocxParser` heading detection — resolves `ParagraphStyleId` (Heading1–9) with `OutlineLevel` fallback
- `DocumentParsers.Cli` console project for manual output inspection (`dotnet run --project src/DocumentParsers.Cli -- <file>`)

### Changed
- `ExtractText()` output upgraded from plain text to structured Markdown (headings + tables)
- `IDocumentParser` XML documentation updated to reflect Markdown output contract

## [0.3.0] - 2026-03-27

### Added
- `HancomMathNormalizer` — Hancom equation script → LaTeX structural conversion (ported from hml-equation-parser architecture)
- `OoxmlMathConverter` — OOXML Math (`m:oMath`) → LaTeX structural conversion for DOCX/PPTX
- Math equation output in `[math: LaTeX]` format for LLM / RAG consumption
- `HwpxParser` now extracts `<hp:equation>` blocks as `[math: ...]` lines
- `DocxParser` now extracts `m:oMath` elements as inline or block `[math: ...]`
- Support for `\frac`, `\sum`, `\int`, `\left`/`\right`, `\widehat` and other LaTeX structures
- Greek and special characters preserved as Unicode (γ, λ, τ, ∞) for direct RAG search hits

### Changed
- `src/DocumentParsers/` reorganized into `Ooxml/` and `Hwpx/` subfolders
- Migrated to independent repository (fieldcure/fieldcure-document-parsers)

## [0.2.0] - 2026-03-25

### Added
- `XlsxParser` — XLSX spreadsheet extraction as markdown tables with SharedString resolution
- `PptxParser` — PPTX slide text, tables, and speaker notes extraction
- `IMediaDocumentParser` interface for parsers with image extraction capability
- `DocumentImage` record for extracted images with label and index
- `DocumentParserFactory.Register()` method for external parser registration (e.g., PDF)

### Changed
- `DocumentParserFactory` now uses `ConcurrentDictionary` for thread-safe dynamic registration
- `SupportedExtensions` now includes `.xlsx` and `.pptx`

## [0.1.0] - 2026-03-22

### Added
- `IDocumentParser` interface for extensible document text extraction
- `DocxParser` — DOCX text extraction with markdown table conversion (via OpenXML SDK)
- `HwpxParser` — HWPX (Korean OWPML) text extraction with markdown table conversion
- `DocumentParserFactory` — extension-based parser resolution with `SupportedExtensions` discovery
- Markdown table output with pipe escaping for LLM / RAG consumption
- NuGet package README with quick start guide