# PdfOptimizationActionResult

Result of applying lossless PDF optimization actions.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[PdfOptimizationActionResult.cs:105](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationActionResult.cs#L105)

**Modifiers**

sealed

Result of applying lossless PDF optimization actions.

## Inheritance

- object
- PdfOptimizationActionResult

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Optimize a PDF without rasterizing pages](/pdf/optimize/) Guide
  
  Apply deterministic lossless PDF optimization, deduplication, compression, or Fast Web View and retain the original when a candidate is not smaller.

## Usage

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

- Method [PdfDocumentOptimization.Apply](/api/pdf/officeimo-pdf-pdfdocumentoptimization/#method-apply-officeimo-pdf-pdfoptimizationoptions-threading-cancellationtoken)

Filter members 

Show inherited

## Methods

`public PdfDocument ToDocument(PdfLoadOptions? readOptions = null)` [#](#method-todocument-officeimo-pdf-pdfloadoptions)

[PdfOptimizationActionResult.cs:105](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationActionResult.cs#L105)

Opens the selected optimized or original bytes through the fluent document API.

Parameters

**readOptions OfficeIMO.Pdf.PdfLoadOptions? = null optional**

Returns

`PdfDocument`

## 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 byte[] Bytes { get; }` [#](#property-bytes)

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

Optimized PDF bytes, or original bytes when no smaller optimized form was produced.

`public long OriginalLengthBytes { get; }` [#](#property-originallengthbytes)

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

Input PDF length in bytes.

`public long OptimizedLengthBytes { get; }` [#](#property-optimizedlengthbytes)

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

Returned PDF length in bytes.

`public long CandidateLengthBytes { get; }` [#](#property-candidatelengthbytes)

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

Optimized candidate length before KeepOriginalWhenNotSmaller is applied, or the smallest known candidate length when serialization stopped at the configured output limit.

`public long SavedBytes { get; }` [#](#property-savedbytes)

[PdfOptimizationActionResult.cs:57](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationActionResult.cs#L57)

Bytes saved in the returned PDF.

`public long CandidateSavedBytes { get; }` [#](#property-candidatesavedbytes)

[PdfOptimizationActionResult.cs:60](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationActionResult.cs#L60)

Bytes the optimized candidate would save before KeepOriginalWhenNotSmaller is applied.

`public PdfOptimizationReport ReportBefore { get; }` [#](#property-reportbefore)

[PdfOptimizationActionResult.cs:63](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationActionResult.cs#L63)

Optimization analysis collected before applying actions.

`public PdfOptimizationReport ReportAfter { get; }` [#](#property-reportafter)

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

Optimization analysis collected from the optimized candidate. When candidate serialization stops at the output limit and the original is retained, this is the unchanged source analysis.

`public IReadOnlyList<PdfOptimizationAction> Actions { get; }` [#](#property-actions)

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

Actions applied while building the optimized candidate.

`public IReadOnlyList<PdfOptimizationSkippedAction> SkippedActions { get; }` [#](#property-skippedactions)

[PdfOptimizationActionResult.cs:75](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationActionResult.cs#L75)

Optimization opportunities skipped while building the candidate.

`public PdfRewritePreservationReport PreservationReport { get; }` [#](#property-preservationreport)

[PdfOptimizationActionResult.cs:78](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationActionResult.cs#L78)

Post-save proof that non-size document contracts were preserved.

`public PdfOptimizationProfile RequestedProfile { get; }` [#](#property-requestedprofile)

[PdfOptimizationActionResult.cs:81](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationActionResult.cs#L81)

Named profile requested for the candidate.

`public PdfOptimizationXrefFormat CandidateXrefFormat { get; }` [#](#property-candidatexrefformat)

[PdfOptimizationActionResult.cs:84](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationActionResult.cs#L84)

Cross-reference representation emitted by the candidate.

`public bool CandidateUsesObjectStreams { get; }` [#](#property-candidateusesobjectstreams)

[PdfOptimizationActionResult.cs:87](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationActionResult.cs#L87)

True when the candidate packs eligible objects into object streams.

`public bool CandidateLinearized { get; }` [#](#property-candidatelinearized)

[PdfOptimizationActionResult.cs:90](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationActionResult.cs#L90)

True when the candidate uses standards-compliant Fast Web View layout and hint tables.

`public bool ReturnedOriginal { get; }` [#](#property-returnedoriginal)

[PdfOptimizationActionResult.cs:93](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationActionResult.cs#L93)

True when the original bytes were returned because the optimized candidate was not smaller.

`public bool Applied { get; }` [#](#property-applied)

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

True when the returned bytes are smaller than the input bytes.

`public int ActionCount { get; }` [#](#property-actioncount)

[PdfOptimizationActionResult.cs:99](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationActionResult.cs#L99)

Number of actions applied while building the optimized candidate.

`public int SkippedActionCount { get; }` [#](#property-skippedactioncount)

[PdfOptimizationActionResult.cs:102](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationActionResult.cs#L102)

Number of skipped optimization opportunities recorded while building the candidate.

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