---
title: "PdfSettings"
canonical_url: "https://www.nutrient.io/api/python/settings/format/pdf-settings/"
md_url: "https://www.nutrient.io/api/python/settings/format/pdf-settings.md"
last_updated: "2026-06-12T15:43:20.748Z"
description: "Settings for Pdf. Values fall back through three levels: document → SDK → built-in default."
---

Settings for Pdf. Values fall back through three levels: document → SDK → built-in default. Writes target the document only when set on a document's settings, otherwise the SDK globally when set on SdkSettings.

**Tags:** `Format`

```python

from nutrient_sdk import PdfSettings

```

## Construction

`PdfSettings` is accessed through a [`Document`](/api/python/document/) instance for per-document overrides, or via [`SdkSettings`](/api/python/settings/document/sdk-settings/) for SDK-wide defaults.

```python

# Per-document override

with Document.open("input.pdf") as doc:
    settings = doc.settings.pdf_settings
    settings.some_field = new_value          # mutate fields directly

# SDK-wide default (applies to all documents)

SdkSettings.pdf_settings.some_field = new_value

```

Settings are configured by writing to fields on the returned object. The settings property itself cannot be reassigned — `doc.settings.pdf_settings = other_settings` is rejected.

## Properties

### bitonal_image_compression

```python

@property
def bitonal_image_compression(self) -> PdfCompression

@bitonal_image_compression.setter
def bitonal_image_compression(self, value: PdfCompression) -> None

```

The compression method to use for bitonal (black and white) images in PDF documents.

**Type:** [`PdfCompression`](/api/python/enums/pdf-compression/)

**Default:** `PdfCompression.PdfCompressionJBIG2`

---

### color_image_compression

```python

@property
def color_image_compression(self) -> PdfCompression

@color_image_compression.setter
def color_image_compression(self, value: PdfCompression) -> None

```

The compression method to use for color images in PDF documents.

**Type:** [`PdfCompression`](/api/python/enums/pdf-compression/)

**Default:** `PdfCompression.PdfCompressionJPEG`

---

### conformance

```python

@property
def conformance(self) -> PdfConformance

@conformance.setter
def conformance(self, value: PdfConformance) -> None

```

The PDF conformance level for the output document.

**Type:** [`PdfConformance`](/api/python/enums/pdf-conformance/)

**Default:** `PdfConformance.PDF1_7`

---

### enable_color_detection

```python

@property
def enable_color_detection(self) -> bool

@enable_color_detection.setter
def enable_color_detection(self, value: bool) -> None

```

Indicates whether automatic color detection is enabled to determine if an image is bitonal or color.

**Type:** `bool`

**Default:** `false`

---

### enable_linearization

```python

@property
def enable_linearization(self) -> bool

@enable_linearization.setter
def enable_linearization(self, value: bool) -> None

```

Indicates whether PDF linearization (fast web view) is enabled. Linearized PDFs can be displayed page-by-page while still downloading.

**Type:** `bool`

**Default:** `false`

---

### force_image_dpi

```python

@property
def force_image_dpi(self) -> int

@force_image_dpi.setter
def force_image_dpi(self, value: int) -> None

```

Forces all images in the PDF to a specific DPI (dots per inch) resolution. A value of 0 means no DPI forcing is applied.

**Type:** `int`

**Default:** `0`

---

### mode

```python

@property
def mode(self) -> PdfSettingsMode

@mode.setter
def mode(self, value: PdfSettingsMode) -> None

```

The mode options for PDF processing.

**Type:** [`PdfSettingsMode`](/api/python/enums/pdf-settings-mode/)

**Default:** `PdfSettingsMode.Unspecified`

---

### optimize

```python

@property
def optimize(self) -> bool

@optimize.setter
def optimize(self, value: bool) -> None

```

Indicates whether PDF optimization is enabled to reduce file size.

**Type:** `bool`

**Default:** `false`

---

### save_preferences

```python

@property
def save_preferences(self) -> PdfSavePreferences

@save_preferences.setter
def save_preferences(self, value: PdfSavePreferences) -> None

```

Preferences for saving PDF documents.

**Type:** [`PdfSavePreferences`](/api/python/enums/pdf-save-preferences/)

**Default:** `PdfSavePreferences.None`

---

### use_deflate_on_jpeg

```python

@property
def use_deflate_on_jpeg(self) -> bool

@use_deflate_on_jpeg.setter
def use_deflate_on_jpeg(self, value: bool) -> None

```

Indicates whether Deflate compression should be applied to JPEG images.

**Type:** `bool`

**Default:** `false`

---

### zlib_level

```python

@property
def zlib_level(self) -> int

@zlib_level.setter
def zlib_level(self, value: int) -> None

```

The compression level for Zlib/Deflate compression. Higher values provide better compression but take longer to process.

**Type:** `int`

**Default:** `4`

---

---

## Related pages

- [Per-document override](/api/python/settings/format/email-settings.md)
- [Per-document override](/api/python/settings/format/html-settings.md)
- [Per-document override](/api/python/settings/format/image-settings.md)
- [Format](/api/python/settings/format.md)
- [Per-document override](/api/python/settings/format/cad-settings.md)
- [Per-document override](/api/python/settings/format/jpeg-settings.md)
- [Per-document override](/api/python/settings/format/spreadsheet-settings.md)
- [Per-document override](/api/python/settings/format/markdown-settings.md)
- [Per-document override](/api/python/settings/format/word-settings.md)

