# PdfTextEncodingDiagnostic

Describes text that cannot be written through the current generated PDF text encoding path.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[PdfTextEncodingDiagnostic.cs:22](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L22)

**Modifiers**

sealed

Describes text that cannot be written through the current generated PDF text encoding path.

## Inheritance

- object
- PdfTextEncodingDiagnostic

## Usage

Explore 7 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 7

- Property [PdfBytesResult.TextEncodingDiagnostics](/api/pdf/officeimo-pdf-pdfbytesresult/#property-textencodingdiagnostics)
- Method [PdfDocument.AnalyzeTextEncoding](/api/pdf/officeimo-pdf-pdfdocument/#method-analyzetextencoding)
- Property [PdfSaveResult.TextEncodingDiagnostics](/api/pdf/officeimo-pdf-pdfsaveresult/#property-textencodingdiagnostics)
- Method [PdfTextEncodingDiagnostic.WithFieldName](/api/pdf/officeimo-pdf-pdftextencodingdiagnostic/#method-withfieldname-string)
- Method [PdfTextEncodingDiagnostic.WithPageNumber](/api/pdf/officeimo-pdf-pdftextencodingdiagnostic/#method-withpagenumber-int32)
- Method [PdfTextEncodingDiagnostic.WithTableCell](/api/pdf/officeimo-pdf-pdftextencodingdiagnostic/#method-withtablecell-int32-int32)
- Property [PdfTextFallbackPlan.Diagnostics](/api/pdf/officeimo-pdf-pdftextfallbackplan/#property-diagnostics)

Filter members 

Show inherited

## Constructors

PdfTextEncodingDiagnostic 7 overloads

`public PdfTextEncodingDiagnostic(string source, int index, string codePoint, string text, bool isControlCharacter)` [#](#constructor-ctor-string-int32-string-string-boolean)

[PdfTextEncodingDiagnostic.cs:22](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L22)

Creates a text encoding diagnostic.

Parameters

**source string required**

Caller-provided source label such as a block, field, sheet, slide, or converter area.

**index int required**

UTF-16 index of the unsupported character in the inspected text.

**codePoint string required**

Unicode code point formatted as U+XXXX or U+XXXXX.

**text string required**

Unsupported character or surrogate pair text. Control characters are represented as an empty string.

**isControlCharacter bool required**

Whether the unsupported character is a control character.

`public PdfTextEncodingDiagnostic(string source, int index, string codePoint, string text, bool isControlCharacter, string encoding, string remediation)` [#](#constructor-ctor-string-int32-string-string-boolean-string-string)

[PdfTextEncodingDiagnostic.cs:55](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L55)

Creates a text encoding diagnostic with a custom encoding or font coverage description.

Parameters

**source string required**

Caller-provided source label such as a block, field, sheet, slide, or converter area.

**index int required**

UTF-16 index of the unsupported character in the inspected text.

**codePoint string required**

Unicode code point formatted as U+XXXX or U+XXXXX.

**text string required**

Unsupported character or surrogate pair text. Control characters are represented as an empty string.

**isControlCharacter bool required**

Whether the unsupported character is a control character.

**encoding string required**

Encoding or font coverage description that rejected the character.

**remediation string required**

Optional remediation guidance for the caller.

`public PdfTextEncodingDiagnostic(string source, int index, string codePoint, string text, bool isControlCharacter, string encoding, string remediation, string location)` [#](#constructor-ctor-string-int32-string-string-boolean-string-string-string)

[PdfTextEncodingDiagnostic.cs:70](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L70)

Creates a text encoding diagnostic with a custom encoding or font coverage description and document location.

Parameters

**source string required**

Caller-provided source label such as a block, field, sheet, slide, or converter area.

**index int required**

UTF-16 index of the unsupported character in the inspected text.

**codePoint string required**

Unicode code point formatted as U+XXXX or U+XXXXX.

**text string required**

Unsupported character or surrogate pair text. Control characters are represented as an empty string.

**isControlCharacter bool required**

Whether the unsupported character is a control character.

**encoding string required**

Encoding or font coverage description that rejected the character.

**remediation string required**

Optional remediation guidance for the caller.

**location string required**

Optional generated document location such as a block, table cell, or canvas item path.

`public PdfTextEncodingDiagnostic(string source, int index, string codePoint, string text, bool isControlCharacter, string encoding, string remediation, string location, int? runIndex)` [#](#constructor-ctor-string-int32-string-string-boolean-string-string-string-nullable-system-int32)

[PdfTextEncodingDiagnostic.cs:86](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L86)

Creates a text encoding diagnostic with a custom encoding or font coverage description, document location, and rich-text run index.

Parameters

**source string required**

Caller-provided source label such as a block, field, sheet, slide, or converter area.

**index int required**

UTF-16 index of the unsupported character in the inspected text.

**codePoint string required**

Unicode code point formatted as U+XXXX or U+XXXXX.

**text string required**

Unsupported character or surrogate pair text. Control characters are represented as an empty string.

**isControlCharacter bool required**

Whether the unsupported character is a control character.

**encoding string required**

Encoding or font coverage description that rejected the character.

**remediation string required**

Optional remediation guidance for the caller.

**location string required**

Optional generated document location such as a block, table cell, or canvas item path.

**runIndex int? required**

Optional zero-based rich text run index inside the generated document location.

`public PdfTextEncodingDiagnostic(string source, int index, string codePoint, string text, bool isControlCharacter, string encoding, string remediation, string location, int? runIndex, int? pageNumber)` [#](#constructor-ctor-string-int32-string-string-boolean-string-string-string-nullable-system-int32-nullable-system-int32)

[PdfTextEncodingDiagnostic.cs:103](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L103)

Creates a text encoding diagnostic with a custom encoding or font coverage description, document location, rich-text run index, and generated page number.

Parameters

**source string required**

Caller-provided source label such as a block, field, sheet, slide, or converter area.

**index int required**

UTF-16 index of the unsupported character in the inspected text.

**codePoint string required**

Unicode code point formatted as U+XXXX or U+XXXXX.

**text string required**

Unsupported character or surrogate pair text. Control characters are represented as an empty string.

**isControlCharacter bool required**

Whether the unsupported character is a control character.

**encoding string required**

Encoding or font coverage description that rejected the character.

**remediation string required**

Optional remediation guidance for the caller.

**location string required**

Optional generated document location such as a block, table cell, or canvas item path.

**runIndex int? required**

Optional zero-based rich text run index inside the generated document location.

**pageNumber int? required**

Optional one-based generated page number for page-scoped diagnostics.

`public PdfTextEncodingDiagnostic(string source, int index, string codePoint, string text, bool isControlCharacter, string encoding, string remediation, string location, int? runIndex, int? pageNumber, int? tableRowIndex, int? tableColumnIndex)` [#](#constructor-ctor-string-int32-string-string-boolean-string-string-string-nullable-system-int32-nullable-system-int32-nullable-system-int32-nullable-system-int32)

[PdfTextEncodingDiagnostic.cs:122](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L122)

Creates a text encoding diagnostic with generated page and table-cell coordinates.

Parameters

**source string required**

Caller-provided source label such as a block, field, sheet, slide, or converter area.

**index int required**

UTF-16 index of the unsupported character in the inspected text.

**codePoint string required**

Unicode code point formatted as U+XXXX or U+XXXXX.

**text string required**

Unsupported character or surrogate pair text. Control characters are represented as an empty string.

**isControlCharacter bool required**

Whether the unsupported character is a control character.

**encoding string required**

Encoding or font coverage description that rejected the character.

**remediation string required**

Optional remediation guidance for the caller.

**location string required**

Optional generated document location such as a block, table cell, or canvas item path.

**runIndex int? required**

Optional zero-based rich text run index inside the generated document location.

**pageNumber int? required**

Optional one-based generated page number for page-scoped diagnostics.

**tableRowIndex int? required**

Optional zero-based table row index for table-cell diagnostics.

**tableColumnIndex int? required**

Optional zero-based table column index for table-cell diagnostics.

`public PdfTextEncodingDiagnostic(string source, int index, string codePoint, string text, bool isControlCharacter, string encoding, string remediation, string location, int? runIndex, int? pageNumber, int? tableRowIndex, int? tableColumnIndex, string? fieldName)` [#](#constructor-ctor-string-int32-string-string-boolean-string-string-string-nullable-system-int32-nullable-system-int32-nullable-system-int32-nullable-system-int32-string)

[PdfTextEncodingDiagnostic.cs:141](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L141)

Creates a text encoding diagnostic with generated page, table-cell coordinates, and form field name.

Parameters

**source string required**

Caller-provided source label such as a block, field, sheet, slide, or converter area.

**index int required**

UTF-16 index of the unsupported character in the inspected text.

**codePoint string required**

Unicode code point formatted as U+XXXX or U+XXXXX.

**text string required**

Unsupported character or surrogate pair text. Control characters are represented as an empty string.

**isControlCharacter bool required**

Whether the unsupported character is a control character.

**encoding string required**

Encoding or font coverage description that rejected the character.

**remediation string required**

Optional remediation guidance for the caller.

**location string required**

Optional generated document location such as a block, table cell, or canvas item path.

**runIndex int? required**

Optional zero-based rich text run index inside the generated document location.

**pageNumber int? required**

Optional one-based generated page number for page-scoped diagnostics.

**tableRowIndex int? required**

Optional zero-based table row index for table-cell diagnostics.

**tableColumnIndex int? required**

Optional zero-based table column index for table-cell diagnostics.

**fieldName string? required**

Optional generated AcroForm field name for form-field diagnostics.

## Methods

`public PdfConversionWarning ToConversionWarning(string converter = "OfficeIMO.Pdf")` [#](#method-toconversionwarning-string)

[PdfTextEncodingDiagnostic.cs:260](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L260)

Converts this text diagnostic to the shared conversion warning shape used by PDF adapters.

Parameters

**converter string = "OfficeIMO.Pdf" optional**

Converter or adapter name to place on the warning.

Returns

`PdfConversionWarning` A shared conversion warning carrying this diagnostic and stable details.

`public PdfTextEncodingDiagnostic WithFieldName(string fieldName)` [#](#method-withfieldname-string)

[PdfTextEncodingDiagnostic.cs:344](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L344)

Returns a copy of this diagnostic annotated with a generated AcroForm field name.

Parameters

**fieldName string required**

Generated field name.

Returns

`PdfTextEncodingDiagnostic` A diagnostic carrying the same text details and the supplied field name.

`public PdfTextEncodingDiagnostic WithPageNumber(int pageNumber)` [#](#method-withpagenumber-int32)

[PdfTextEncodingDiagnostic.cs:316](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L316)

Returns a copy of this diagnostic annotated with a one-based generated page number.

Parameters

**pageNumber int required**

One-based generated page number.

Returns

`PdfTextEncodingDiagnostic` A diagnostic carrying the same text details and the supplied page number.

`public PdfTextEncodingDiagnostic WithTableCell(int rowIndex, int columnIndex)` [#](#method-withtablecell-int32-int32)

[PdfTextEncodingDiagnostic.cs:327](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L327)

Returns a copy of this diagnostic annotated with zero-based table cell coordinates.

Parameters

**rowIndex int required**

Zero-based table row index.

**columnIndex int required**

Zero-based table column index.

Returns

`PdfTextEncodingDiagnostic` A diagnostic carrying the same text details and the supplied table cell coordinates.

## 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 string Source { get; }` [#](#property-source)

[PdfTextEncodingDiagnostic.cs:210](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L210)

Caller-provided source label such as a block, field, sheet, slide, or converter area.

`public int Index { get; }` [#](#property-index)

[PdfTextEncodingDiagnostic.cs:213](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L213)

UTF-16 index of the unsupported character in the inspected text.

`public string CodePoint { get; }` [#](#property-codepoint)

[PdfTextEncodingDiagnostic.cs:216](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L216)

Unicode code point formatted as U+XXXX or U+XXXXX.

`public string Text { get; }` [#](#property-text)

[PdfTextEncodingDiagnostic.cs:219](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L219)

Unsupported character or surrogate pair text. Control characters are represented as an empty string.

`public bool IsControlCharacter { get; }` [#](#property-iscontrolcharacter)

[PdfTextEncodingDiagnostic.cs:222](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L222)

Whether the unsupported character is a control character.

`public string Encoding { get; }` [#](#property-encoding)

[PdfTextEncodingDiagnostic.cs:225](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L225)

Encoding or font coverage description that rejected the character.

`public string Remediation { get; }` [#](#property-remediation)

[PdfTextEncodingDiagnostic.cs:228](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L228)

Optional remediation guidance for the caller.

`public string Location { get; }` [#](#property-location)

[PdfTextEncodingDiagnostic.cs:231](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L231)

Optional generated document location such as a block, table cell, or canvas item path.

`public int? RunIndex { get; }` [#](#property-runindex)

[PdfTextEncodingDiagnostic.cs:234](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L234)

Optional zero-based rich text run index inside the generated document location.

`public int? PageNumber { get; }` [#](#property-pagenumber)

[PdfTextEncodingDiagnostic.cs:237](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L237)

Optional one-based generated page number for page-scoped diagnostics.

`public int? TableRowIndex { get; }` [#](#property-tablerowindex)

[PdfTextEncodingDiagnostic.cs:240](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L240)

Optional zero-based table row index for table-cell diagnostics.

`public int? TableColumnIndex { get; }` [#](#property-tablecolumnindex)

[PdfTextEncodingDiagnostic.cs:243](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L243)

Optional zero-based table column index for table-cell diagnostics.

`public string FieldName { get; }` [#](#property-fieldname)

[PdfTextEncodingDiagnostic.cs:246](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L246)

Optional generated AcroForm field name for form-field diagnostics.

`public string Code { get; }` [#](#property-code)

[PdfTextEncodingDiagnostic.cs:249](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L249)

Stable warning code suitable for shared conversion reports.

`public string Message { get; }` [#](#property-message)

[PdfTextEncodingDiagnostic.cs:252](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Model/PdfTextEncodingDiagnostic.cs#L252)

Human-readable diagnostic message.

<!-- PowerForge markdown artifact sha256:D00B61B6ACEB9F77A0CCA0B2E885B363050AF6D09232A5A22B4FE1E579B3F377 -->
