# PdfImageOptimizationOptions

Controls optional placement-aware image downsampling during PDF generation.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[PdfImageOptimizationOptions.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfImageOptimizationOptions.cs#L7)

**Modifiers**

sealed

Controls optional placement-aware image downsampling during PDF generation.

## Inheritance

- object
- PdfImageOptimizationOptions

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

- Property [PdfCreateOptions.ImageOptimization](/api/pdf/officeimo-pdf-pdfcreateoptions/#property-imageoptimization)
- Method [PdfImageOptimizationOptions.Clone](/api/pdf/officeimo-pdf-pdfimageoptimizationoptions/#method-clone)

Filter members 

Show inherited

## Constructors

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

[PdfImageOptimizationOptions.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfImageOptimizationOptions.cs#L7)

## Methods

`public PdfImageOptimizationOptions Clone()` [#](#method-clone)

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

Creates an independent copy of these options.

Returns

`PdfImageOptimizationOptions`

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

[PdfImageOptimizationOptions.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfImageOptimizationOptions.cs#L13)

Enables managed placement-aware image optimization. Disabled by default.

`public OfficeImageOptimizationMode Mode { get; set; }` [#](#property-mode)

[PdfImageOptimizationOptions.cs:17](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Options/PdfImageOptimizationOptions.cs#L17)

Selects placement downsampling, same-size JPEG recompression, or both. Defaults to downsampling.

`public double TargetDpi { get; set; }` [#](#property-targetdpi)

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

Target image resolution in pixels per inch. Defaults to 144.

`public double DownsampleThreshold { get; set; }` [#](#property-downsamplethreshold)

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

Minimum ratio between source pixels and placement-required pixels before downsampling. Defaults to 1.1 to avoid re-encoding for negligible reductions.

`public OfficeRasterResamplingMode ResamplingMode { get; set; }` [#](#property-resamplingmode)

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

Sampling mode used when source pixels are reduced.

`public int JpegQuality { get; set; }` [#](#property-jpegquality)

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

Quality used when a JPEG source is downsampled or recompressed. Defaults to 85.

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

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

Keeps the original encoded payload when optimized bytes are not smaller.

`public OfficeImageMetadataPolicy MetadataPolicy { get; set; }` [#](#property-metadatapolicy)

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

Metadata behavior for rewritten images. Defaults to preservation.

`public OfficeImageMetadataKinds MetadataSelection { get; set; }` [#](#property-metadataselection)

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

Metadata categories retained by selective copying.

`public bool AllowMetadataLoss { get; set; }` [#](#property-allowmetadataloss)

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

Permits reported metadata loss or deliberate stripping. False preserves the original image if metadata would be removed.

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