# AdfDocument

Represents an Atlas Document Format document while retaining fields that OfficeIMO does not yet understand.

Class 

`OfficeIMO.Adf`

**Namespace**

`OfficeIMO.Adf`

**Assembly**

`OfficeIMO.Adf`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[AdfDocument.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L29)

**Modifiers**

sealed

Represents an Atlas Document Format document while retaining fields that OfficeIMO does not yet understand.

## Inheritance

- object
- AdfDocument

## Usage

Explore 6 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 3

- Method [AdfConverter.FromHtml](/api/adf/officeimo-adf-adfconverter/#method-fromhtml-string-officeimo-markdown-html-htmlmarkdownexportoptions)
- Method [AdfConverter.FromMarkdown](/api/adf/officeimo-adf-adfconverter/#method-frommarkdown-string)
- Method [AdfDocument.Parse](/api/adf/officeimo-adf-adfdocument/#method-parse-string)

### Accepted by parameters 3

- Method [AdfConverter.ToHtml](/api/adf/officeimo-adf-adfconverter/#method-tohtml-officeimo-adf-adfdocument-officeimo-markdown-markdownhtmlexportoptions-officeimo-adf-adfconversionoptions) parameter `document`
- Method [AdfConverter.ToMarkdown](/api/adf/officeimo-adf-adfconverter/#method-tomarkdown-officeimo-adf-adfdocument-officeimo-adf-adfconversionoptions) parameter `document`
- Method [AdfConverter.ToMarkdownDocument](/api/adf/officeimo-adf-adfconverter/#method-tomarkdowndocument-officeimo-adf-adfdocument-officeimo-adf-adfconversionoptions) parameter `document`

Filter members 

Show inherited

## Constructors

AdfDocument 2 overloads

`public AdfDocument()` [#](#constructor-ctor)

[AdfDocument.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L29)

Creates an empty ADF document.

`public AdfDocument(IEnumerable<AdfNode>? content)` [#](#constructor-ctor-collections-generic-ienumerable-officeimo-adf-adfnode)

[AdfDocument.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L29)

Creates an ADF document with the supplied top-level nodes.

Parameters

**content System.Collections.Generic.IEnumerable<OfficeIMO.Adf.AdfNode>? required**

## Methods

Parse 2 overloads

`public static AdfDocument Parse(string json)` [#](#method-parse-string)

[AdfDocument.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L49)

Parses an ADF JSON document and retains unrecognized fields for round trips.

Parameters

**json string required**

Returns

`AdfDocument`

`public static AdfDocument Parse(string json, AdfProcessingOptions options)` [#](#method-parse-string-officeimo-adf-adfprocessingoptions)

[AdfDocument.cs:52](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L52)

Parses ADF JSON with explicit resource limits and cancellation.

Parameters

**json string required**

**options OfficeIMO.Adf.AdfProcessingOptions required**

Returns

`AdfDocument`

ToJson 2 overloads

`public string ToJson(bool indented = false)` [#](#method-tojson-boolean)

[AdfDocument.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L56)

Serializes this document to ADF JSON without performing structural validation.

Parameters

**indented bool = false optional**

Returns

`string`

`public string ToJson(AdfProcessingOptions options, bool indented = false)` [#](#method-tojson-officeimo-adf-adfprocessingoptions-boolean)

[AdfDocument.cs:59](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L59)

Serializes ADF JSON with explicit resource limits and cancellation.

Parameters

**options OfficeIMO.Adf.AdfProcessingOptions required**

**indented bool = false optional**

Returns

`string`

Validate 4 overloads

`public AdfValidationResult Validate()` [#](#method-validate)

[AdfDocument.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L62)

Validates the structural ADF contract without rejecting unknown node or mark types.

Returns

`AdfValidationResult`

`public AdfValidationResult Validate(AdfProcessingOptions options)` [#](#method-validate-officeimo-adf-adfprocessingoptions)

[AdfDocument.cs:66](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L66)

Validates ADF structure with explicit resource limits and cancellation.

Parameters

**options OfficeIMO.Adf.AdfProcessingOptions required**

Returns

`AdfValidationResult`

`public AdfValidationResult Validate(AdfValidationOptions options)` [#](#method-validate-officeimo-adf-adfvalidationoptions)

[AdfDocument.cs:71](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L71)

Validates against the selected structural or bundled full-schema contract.

Parameters

**options OfficeIMO.Adf.AdfValidationOptions required**

Returns

`AdfValidationResult`

`public AdfValidationResult Validate(AdfValidationOptions options, CancellationToken cancellationToken)` [#](#method-validate-officeimo-adf-adfvalidationoptions-threading-cancellationtoken)

[AdfDocument.cs:75](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L75)

Validates against the selected contract with cancellation during graph and rule traversal.

Parameters

**options OfficeIMO.Adf.AdfValidationOptions required**

**cancellationToken System.Threading.CancellationToken required**

Returns

`AdfValidationResult`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public int Version { get; set; }` [#](#property-version)

[AdfDocument.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L29)

ADF schema version.

`public string Type { get; set; }` [#](#property-type)

[AdfDocument.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L32)

Root node type. A normal ADF document uses doc.

`public List<AdfNode> Content { get; }` [#](#property-content)

[AdfDocument.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L35)

Top-level document nodes.

`public IDictionary<string, JsonElement> ExtensionData { get; }` [#](#property-extensiondata)

[AdfDocument.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L39)

Unknown root properties retained during parse/write round trips.

<!-- PowerForge markdown artifact sha256:5D0D534DA7FAEC864D8C64BC3D9F748A90F94DD2A4FCB0104646944C45CB88F3 -->
