# PdfBytesResult

Result returned by non-throwing in-memory PDF byte generation.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[PdfBytesResult.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L58)

**Implements**

`IOfficeResult<byte[]>` `IOfficeResult`

**Modifiers**

sealed

Result returned by non-throwing in-memory PDF byte generation.

## Inheritance

- object
- PdfBytesResult

## Usage

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

- Method [PdfBytesResult.FromFailure](/api/pdf/officeimo-pdf-pdfbytesresult/#method-fromfailure-exception)
- Method [PdfBytesResult.FromSuccess](/api/pdf/officeimo-pdf-pdfbytesresult/#method-fromsuccess-byte)

Filter members 

Show inherited

## Methods

`public static PdfBytesResult FromFailure(Exception exception)` [#](#method-fromfailure-exception)

[PdfBytesResult.cs:79](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L79)

Creates a failed byte generation result from an exception captured by a wrapper or adapter.

Parameters

**exception System.Exception required**

Returns

`PdfBytesResult`

`public static PdfBytesResult FromSuccess(byte[] bytes)` [#](#method-fromsuccess-byte)

[PdfBytesResult.cs:73](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L73)

Creates a successful byte generation result.

Parameters

**bytes byte[] required**

Returns

`PdfBytesResult`

`public byte[] RequireBytes()` [#](#method-requirebytes)

[PdfBytesResult.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L58)

Returns generated PDF bytes or throws with diagnostics when generation failed.

Returns

`byte[]`

`public byte[] RequireValue()` [#](#method-requirevalue)

[PdfBytesResult.cs:69](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L69)

Returns the produced value or throws when the operation did not complete.

Returns

`byte[]`

## 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 bool Succeeded { get; }` [#](#property-succeeded)

[PdfBytesResult.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L24)

True when byte generation completed.

`public byte[] Bytes { get; }` [#](#property-bytes)

[PdfBytesResult.cs:27](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L27)

Generated PDF bytes when the operation completed; otherwise an empty array.

`public byte[] Value { get; }` [#](#property-value)

[PdfBytesResult.cs:30](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L30)

Gets the produced value, or null when the operation did not complete.

`public long ByteCount { get; }` [#](#property-bytecount)

[PdfBytesResult.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L33)

Number of generated bytes when the operation completed; otherwise 0.

`public IReadOnlyList<string> Diagnostics { get; }` [#](#property-diagnostics)

[PdfBytesResult.cs:36](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L36)

Human-readable diagnostics explaining why byte generation failed.

`public Exception? Exception { get; }` [#](#property-exception)

[PdfBytesResult.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L39)

Exception captured from the byte generation attempt, when available.

`public IReadOnlyList<PdfTextEncodingDiagnostic> TextEncodingDiagnostics { get; }` [#](#property-textencodingdiagnostics)

[PdfBytesResult.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L42)

Structured text encoding diagnostics captured from PDF generation failures.

`public PdfConversionReport Report { get; }` [#](#property-report)

[PdfBytesResult.cs:45](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L45)

Structured PDF output warnings captured for this byte-generation attempt.

`public PdfPipelineReport Pipeline { get; }` [#](#property-pipeline)

[PdfBytesResult.cs:48](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L48)

End-to-end create/open, mutation, and byte-generation evidence.

`public IReadOnlyList<PdfConversionWarning> Warnings { get; }` [#](#property-warnings)

[PdfBytesResult.cs:51](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L51)

Structured PDF output warnings captured for this byte-generation attempt.

`public bool HasWarnings { get; }` [#](#property-haswarnings)

[PdfBytesResult.cs:54](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfBytesResult.cs#L54)

True when PDF output produced a warning.

<!-- PowerForge markdown artifact sha256:1B21B403BE3C94E2D3E5A348DFB57485A8638BB0C5546A2DD2F4FA5CC9D83FAC -->
