# PdfSaveResult

Result returned by file and stream output operations.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[PdfSaveResult.cs:76](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L76)

**Implements**

`IOfficeOutputResult` `IOfficeResult`

**Modifiers**

sealed

Result returned by file and stream output operations.

## Inheritance

- object
- PdfSaveResult

## Usage

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

- Method [PdfDocumentConversionResult.Save](/api/pdf/officeimo-pdf-pdfdocumentconversionresult/#method-save-io-stream)
- Method [PdfDocumentConversionResult.SaveAsync](/api/pdf/officeimo-pdf-pdfdocumentconversionresult/#method-saveasync-io-stream-threading-cancellationtoken)
- Method [PdfSaveResult.FromFailure](/api/pdf/officeimo-pdf-pdfsaveresult/#method-fromfailure-string-exception)
- Method [PdfSaveResult.FromSuccess](/api/pdf/officeimo-pdf-pdfsaveresult/#method-fromsuccess-string-int64)
- Method [PdfSaveResult.RequireSuccess](/api/pdf/officeimo-pdf-pdfsaveresult/#method-requiresuccess)

Filter members 

Show inherited

## Methods

FromFailure 2 overloads

`public static PdfSaveResult FromFailure(string? outputPath, Exception exception)` [#](#method-fromfailure-string-exception)

[PdfSaveResult.cs:101](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L101)

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

Parameters

**outputPath string? required**

**exception System.Exception required**

Returns

`PdfSaveResult`

`public static PdfSaveResult FromFailure(string? outputPath, Exception exception, OfficeConversionReport sourceConversionReport)` [#](#method-fromfailure-string-exception-officeimo-officeconversionreport)

[PdfSaveResult.cs:107](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L107)

Creates a failed save result while retaining the source-stage report that caused the failure.

Parameters

**outputPath string? required**

**exception System.Exception required**

**sourceConversionReport OfficeIMO.OfficeConversionReport required**

Returns

`PdfSaveResult`

`public static PdfSaveResult FromSuccess(string? outputPath, long bytesWritten)` [#](#method-fromsuccess-string-int64)

[PdfSaveResult.cs:96](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L96)

Creates a successful save result.

Parameters

**outputPath string? required**

**bytesWritten long required**

Returns

`PdfSaveResult`

`public PdfSaveResult RequireSuccess()` [#](#method-requiresuccess)

[PdfSaveResult.cs:76](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L76)

Returns this result or throws with diagnostics when the save failed.

Returns

`PdfSaveResult`

`public void ThrowIfLoss()` [#](#method-throwifloss)

[PdfSaveResult.cs:88](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L88)

Requires a successful save without reported conversion loss.

## 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)

[PdfSaveResult.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L32)

True when the save operation completed.

`public string? OutputPath { get; }` [#](#property-outputpath)

[PdfSaveResult.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L35)

Full output path when the operation targeted a file path.

`public long BytesWritten { get; }` [#](#property-byteswritten)

[PdfSaveResult.cs:38](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L38)

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

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

[PdfSaveResult.cs:41](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L41)

Human-readable diagnostics explaining why the save failed.

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

[PdfSaveResult.cs:44](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L44)

Exception captured from the save attempt, when available.

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

[PdfSaveResult.cs:47](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L47)

Structured text encoding diagnostics captured from PDF generation failures.

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

[PdfSaveResult.cs:50](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L50)

Snapshot of PDF-stage structured output warnings for this save attempt.

`public IReadOnlyList<OfficeConversionReport> ConversionReports { get; }` [#](#property-conversionreports)

[PdfSaveResult.cs:53](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L53)

Ordered source-stage reports followed by the PDF-stage report, when conversion preceded the save.

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

[PdfSaveResult.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L56)

End-to-end create/open, mutation, and output evidence for this save attempt.

`public PdfSerializationReport? Serialization { get; }` [#](#property-serialization)

[PdfSaveResult.cs:59](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L59)

Bounded serialization evidence for a successful save, when available.

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

[PdfSaveResult.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L62)

PDF-stage structured output warnings for this save attempt.

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

[PdfSaveResult.cs:65](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L65)

True when the PDF stage produced a structured output warning.

`public bool HasLoss { get; }` [#](#property-hasloss)

[PdfSaveResult.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L68)

True when any source or PDF conversion stage reported possible content loss.

`public IReadOnlyList<OfficeDiagnostic> ConversionDiagnostics { get; }` [#](#property-conversiondiagnostics)

[PdfSaveResult.cs:72](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfSaveResult.cs#L72)

All source and PDF-stage diagnostics with their original loss categories preserved.

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