This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /api/python/settings/vision/advanced/pp-text-rec-settings.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. PPTextRecSettings

Settings for PPTextRec. 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: Vision, Advanced

from nutrient_sdk import PPTextRecSettings

Construction

PPTextRecSettings is accessed through a Document instance for per-document overrides, or via SdkSettings for SDK-wide defaults.

# Per-document override
with Document.open("input.pdf") as doc:
settings = doc.settings.pp_text_rec_settings
settings.some_field = new_value # mutate fields directly
# SDK-wide default (applies to all documents)
SdkSettings.pp_text_rec_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.pp_text_rec_settings = other_settings is rejected.

Properties

batch_size

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

Batch size for text recognition inference. Higher values improve GPU throughput but require more memory. CPU execution is automatically limited to batches of 16. Set to 1 to disable batching (process one image at a time).

Type: int

Default: 64


config_path

@property
def config_path(self) -> str
@config_path.setter
def config_path(self, value: str) -> None

Path to the generated, line-delimited PP-OCRv5 recognition dictionary.

Type: str

Default: GetDefaultDictionaryPath()


max_image_width

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

Maximum width for text images

Type: int

Default: 3200


model_path

@property
def model_path(self) -> str
@model_path.setter
def model_path(self, value: str) -> None

Path to the encrypted PP-OCRv5 recognition model.

Type: str

Default: GetDefaultModelPath()


use_cpu_only

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

Enable CPU mode for ONNX Runtime. When true, forces CPU execution. When false, uses default providers.

Type: bool

Default: false