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 PPTextRecSettingsConstruction
PPTextRecSettings is accessed through a Document instance for per-document overrides, or via SdkSettings for SDK-wide defaults.
# Per-document overridewith 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_valueSettings 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
@propertydef batch_size(self) -> int
@batch_size.setterdef batch_size(self, value: int) -> NoneBatch 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
@propertydef config_path(self) -> str
@config_path.setterdef config_path(self, value: str) -> NonePath to the generated, line-delimited PP-OCRv5 recognition dictionary.
Type: str
Default: GetDefaultDictionaryPath()
max_image_width
@propertydef max_image_width(self) -> int
@max_image_width.setterdef max_image_width(self, value: int) -> NoneMaximum width for text images
Type: int
Default: 3200
model_path
@propertydef model_path(self) -> str
@model_path.setterdef model_path(self, value: str) -> NonePath to the encrypted PP-OCRv5 recognition model.
Type: str
Default: GetDefaultModelPath()
use_cpu_only
@propertydef use_cpu_only(self) -> bool
@use_cpu_only.setterdef use_cpu_only(self, value: bool) -> NoneEnable CPU mode for ONNX Runtime. When true, forces CPU execution. When false, uses default providers.
Type: bool
Default: false