# PdfOptimizationOptions

Options for lossless PDF optimization actions.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

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

**Implements**

`IPdfOperationCancellation`

**Modifiers**

sealed

Options for lossless PDF optimization actions.

## Inheritance

- object
- PdfOptimizationOptions

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

- Method [PdfOptimizationOptions.Create](/api/pdf/officeimo-pdf-pdfoptimizationoptions/#method-create-officeimo-pdf-pdfoptimizationprofile)

### Accepted by parameters 1

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

Filter members 

Show inherited

## Constructors

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

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

## Methods

`public static PdfOptimizationOptions Create(PdfOptimizationProfile profile)` [#](#method-create-officeimo-pdf-pdfoptimizationprofile)

[PdfOptimizationOptions.cs:82](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationOptions.cs#L82)

Creates a stable option set for a named profile.

Parameters

**profile OfficeIMO.Pdf.PdfOptimizationProfile required**

Returns

`PdfOptimizationOptions`

## 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 PdfOptimizationProfile Profile { get; set; }` [#](#property-profile)

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

Named profile used to create this option set.

`public bool CompressUnfilteredStreams { get; set; }` [#](#property-compressunfilteredstreams)

[PdfOptimizationOptions.cs:37](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationOptions.cs#L37)

Compress unfiltered stream objects with FlateDecode when the compressed form is smaller.

`public bool RemoveUnreferencedObjects { get; set; }` [#](#property-removeunreferencedobjects)

[PdfOptimizationOptions.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationOptions.cs#L40)

Remove indirect objects that are not reachable from the document catalog during a safe full rewrite.

`public bool DeduplicateIdenticalStreams { get; set; }` [#](#property-deduplicateidenticalstreams)

[PdfOptimizationOptions.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationOptions.cs#L43)

Rewrite references so byte-identical stream objects share one indirect object.

`public bool DeduplicateImages { get; set; }` [#](#property-deduplicateimages)

[PdfOptimizationOptions.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationOptions.cs#L46)

Deduplicate image XObjects by decoded lossless sample data and semantic image dictionary.

`public bool DeduplicateFonts { get; set; }` [#](#property-deduplicatefonts)

[PdfOptimizationOptions.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationOptions.cs#L49)

Deduplicate byte-identical font dictionaries that share the same referenced font resources.

`public bool DeduplicateResources { get; set; }` [#](#property-deduplicateresources)

[PdfOptimizationOptions.cs:52](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationOptions.cs#L52)

Deduplicate indirect page/form resource dictionaries with identical serialized structure.

`public bool UseObjectStreams { get; set; }` [#](#property-useobjectstreams)

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

Pack eligible non-stream objects into PDF 1.5 object streams.

`public PdfOptimizationXrefFormat XrefFormat { get; set; }` [#](#property-xrefformat)

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

Cross-reference representation for the optimized candidate.

`public bool Linearize { get; set; }` [#](#property-linearize)

[PdfOptimizationOptions.cs:61](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationOptions.cs#L61)

Emit standards-compliant Fast Web View linearization with classic cross-reference tables and primary hint tables.

`public int MaximumDecodedImageBytes { get; set; }` [#](#property-maximumdecodedimagebytes)

[PdfOptimizationOptions.cs:64](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationOptions.cs#L64)

Maximum decoded image bytes considered for semantic image deduplication.

`public long MaximumTotalDecodedImageBytes { get; set; }` [#](#property-maximumtotaldecodedimagebytes)

[PdfOptimizationOptions.cs:67](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfOptimizationOptions.cs#L67)

Maximum aggregate decoded image bytes inspected for semantic deduplication.

`public long? MaximumOutputBytes { get; set; }` [#](#property-maximumoutputbytes)

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

Optional maximum bytes retained and emitted for the optimized artifact.

`public bool KeepOriginalWhenNotSmaller { get; set; }` [#](#property-keeporiginalwhennotsmaller)

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

Return the original PDF bytes when the optimized output would not be smaller.

`public int MinimumStreamCompressionBytes { get; set; }` [#](#property-minimumstreamcompressionbytes)

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

Minimum unfiltered stream size considered for compression.

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