Table of Contents

Class DocumentToMarkdownResult

Namespace
LMKit.Document.Conversion
Assembly
LM-Kit.NET.dll

Represents the outcome of a document → Markdown conversion performed by DocumentToMarkdown.

public sealed class DocumentToMarkdownResult
Inheritance
DocumentToMarkdownResult
Inherited Members

Examples

using LMKit.Document.Conversion;

var converter = new DocumentToMarkdown();
var result = converter.Convert("report.pdf");

File.WriteAllText("report.md", result.Markdown);

foreach (var page in result.Pages)
{
    Console.WriteLine($"Page {page.PageNumber}: {page.StrategyUsed} ({page.Elapsed.TotalMilliseconds:F0} ms)");
}

Remarks

The Markdown property contains the final aggregated Markdown suitable for LLM ingestion or downstream processing. The Pages list preserves per-page diagnostics, including which strategy was effectively used for each page.

Properties

Certainty

Gets a confidence score in the [0, 1] range that the aggregated Markdown faithfully represents the source document. 1.0 means LM-Kit is highly confident every page of the source was rendered correctly; lower values signal that at least one page introduces risk — garbled OCR, missed structure, truncated output, unresolved layout ambiguity, and so on.

EffectiveStrategy

Gets the strategy the converter resolved to for this run. When the requested strategy is Hybrid and the source is an image attachment, the effective strategy is collapsed to VlmOcr. For paginated inputs the effective strategy remains Hybrid and the actual per-page choice is reported on each StrategyUsed.

Elapsed

Gets the total elapsed time of the conversion.

Markdown

Gets the aggregated Markdown content produced by the conversion.

Pages

Gets the per-page conversion results in document order.

RequestedStrategy

Gets the strategy that was requested by the caller.

SourceName

Gets the logical name of the source that was converted (file name, stream name, or URI), when available. May be null for anonymous inputs.

Share