pub struct ConvertOptions {Show 56 fields
pub strict: Option<bool>,
pub compact_tables: Option<bool>,
pub page_break_placeholder: Option<String>,
pub fetch_images: Option<bool>,
pub image_sources: Option<String>,
pub image_hosts: Option<Vec<String>>,
pub max_image_bytes: Option<u64>,
pub max_images: Option<usize>,
pub max_image_total_mb: Option<u64>,
pub min_image_bytes: Option<u64>,
pub list_attachments: Option<bool>,
pub skip_empty_cells: Option<bool>,
pub ebcdic_layout: Option<String>,
pub encoding: Option<String>,
pub use_web_browser: Option<bool>,
pub xbrl_taxonomy: Option<String>,
pub asr_model: Option<String>,
pub asr_lang: Option<String>,
pub video_frames: Option<usize>,
pub video_scene_threshold: Option<f32>,
pub video_frame_max_side: Option<u32>,
pub video_frame_dedupe: Option<u32>,
pub pages: Option<String>,
pub document_timeout: Option<f64>,
pub text_layer_only: Option<bool>,
pub no_ocr: Option<bool>,
pub skip_ocr: Option<bool>,
pub password: Option<String>,
pub force_full_page_ocr: Option<bool>,
pub no_table_former: Option<bool>,
pub no_text_panels: Option<bool>,
pub heading_hierarchy: Option<bool>,
pub ocr_engine: Option<String>,
pub ocr_lang: Option<String>,
pub ocr_mode: Option<String>,
pub ocr_scale: Option<f32>,
pub images_scale: Option<f32>,
pub page_images: Option<bool>,
pub do_picture_classification: Option<bool>,
pub do_code_enrichment: Option<bool>,
pub do_formula_enrichment: Option<bool>,
pub do_picture_ocr: Option<bool>,
pub picture_ocr_classes: Option<String>,
pub picture_ocr_min_side: Option<u32>,
pub keep_picture_images: Option<bool>,
pub redact_pii: Option<bool>,
pub redact_mode: Option<String>,
pub redact_kinds: Option<String>,
pub redact_pattern: Option<String>,
pub redact_images: Option<String>,
pub pipeline: Option<String>,
pub vlm_endpoint: Option<String>,
pub vlm_model: Option<String>,
pub vlm_api_key: Option<String>,
pub vlm_prompt: Option<String>,
pub vlm_max_tokens: Option<usize>,
}Expand description
Conversion options as every surface accepts them — see the module docs.
None everywhere is the engine’s defaults.
Fields§
§strict: Option<bool>Cleaner, more conformant Markdown (DocumentConverter::strict).
compact_tables: Option<bool>Compact | a | b | Markdown tables instead of width padding (#271).
page_break_placeholder: Option<String>Text inserted between pages in the Markdown export (docling-core’s
MarkdownParams.page_break_placeholder); docling-serve’s historical
spelling md_page_break_placeholder is accepted as an alias.
fetch_images: Option<bool>Resolve external <img src> for HTML/EPUB/MHTML/JATS (network access)
— the pre-#646 switch: true is image_sources=remote, false is
none; an explicit image_sources wins.
image_sources: Option<String>Which image references resolve (#646): none (default — every picture
a placeholder) | embedded (data: URIs and parts of the same
container: EPUB/MHTML entries, email cid: attachments; no
filesystem or network) | local (plus files under the source file’s
directory) | remote (plus http(s) fetches). HTML, EPUB, MHTML,
JATS, AsciiDoc, ODF, Markdown and email bodies.
image_hosts: Option<Vec<String>>Hosts a remote image fetch may reach (#646): exact names or
*.suffix wildcards, a list or a comma-separated string; unset =
any host. A redirect is held to the same list.
max_image_bytes: Option<u64>Largest image that resolves, in bytes (#646; 32 MiB,
DOCLING_RS_MAX_IMAGE_BYTES).
max_images: Option<usize>How many images resolve per document; the rest stay placeholders
(#646; unlimited, DOCLING_RS_MAX_IMAGES).
max_image_total_mb: Option<u64>Total resolved image bytes per document, in MiB (#646; unlimited,
DOCLING_RS_MAX_IMAGE_TOTAL_MB).
min_image_bytes: Option<u64>Smallest image that resolves, in bytes — skips spacer / tracking
pixels (#646; 0, DOCLING_RS_MIN_IMAGE_BYTES).
list_attachments: Option<bool>Email (.eml/.msg): append an Attachments section (#251).
skip_empty_cells: Option<bool>Omit empty cells from sparse XLSX/XLS table grids (#271).
ebcdic_layout: Option<String>EBCDIC copybook layout (#252): inline JSON or a file path.
encoding: Option<String>Character encoding of text inputs (a WHATWG label); unset = detect.
use_web_browser: Option<bool>Pre-render HTML with a headless browser (the web-browser feature).
xbrl_taxonomy: Option<String>XBRL: the directory the instance’s taxonomy is read from.
asr_model: Option<String>ASR preset (whisper_*, parakeet_tdt_0.6b_v3); unset = Whisper tiny.
asr_lang: Option<String>Transcription language (a Whisper code) or auto.
video_frames: Option<usize>Max frames sampled from a video (0 = transcript only); unset =
crate::DEFAULT_VIDEO_FRAMES. "all" — or any count at or above
u32::MAX — is crate::ALL_VIDEO_FRAMES: every distinct cut (#647).
video_scene_threshold: Option<f32>ffmpeg’s scene score (0–1) a video frame must exceed to be a cut
(#647); unset = 0.27 (DOCLING_RS_VIDEO_SCENE_THRESHOLD).
video_frame_max_side: Option<u32>Cap on a sampled video frame’s longer side in px, applied inside
ffmpeg (#647); 0 / unset = the source resolution
(DOCLING_RS_VIDEO_FRAME_MAX_SIDE).
video_frame_dedupe: Option<u32>Hamming distance (0–64) of the difference hash under which a sampled
frame is a duplicate of a kept one and dropped (#647); unset = keep
every frame (DOCLING_RS_VIDEO_FRAME_DEDUPE).
pages: Option<String>PDF page window, "A-B" or a single "N" (1-based inclusive, #80).
document_timeout: Option<f64>Per-document budget in seconds for the PDF pipeline (#497).
text_layer_only: Option<bool>Skip the whole ML stack: text layer only (#611; no_ocr before 2.0).
no_ocr: Option<bool>Keep layout + TableFormer, never run OCR — docling’s do_ocr=False,
its CLI’s --no-ocr (#611).
skip_ocr: Option<bool>no_ocr under its pre-2.0 name (#244), still read: either one set
skips OCR (Self::ocr_disabled). A field of its own rather than a
serde alias, so a body that sends both spellings (a pre-2.0 form)
is not a duplicate-field error.
password: Option<String>The password of an encrypted PDF or Office document (#611, #625).
pdf_password, docling’s PDF-only name (--pdf-password), is read
as an alias.
force_full_page_ocr: Option<bool>OCR every page, discarding the text layer.
no_table_former: Option<bool>Skip TableFormer (geometric tables instead).
no_text_panels: Option<bool>Disable the text-panel heuristic (#173).
heading_hierarchy: Option<bool>Infer heading levels after assembly (#302).
ocr_engine: Option<String>ppocr (default) | tesseract (#460).
ocr_lang: Option<String>OCR language: en | ch or a BCP-47 tag under PP-OCR, tessdata stems
or BCP-47 tags under Tesseract.
ocr_mode: Option<String>docling’s OcrMode (#254): default | full_page | layout_regions
| pdf_aware_layout_regions.
ocr_scale: Option<f32>OCR input scale in px per PDF point (#254); unset = the 2.0 render.
images_scale: Option<f32>Picture-crop / page-image scale in px per point, 0.1–4.0 (#520).
page_images: Option<bool>Keep each page’s render as the JSON page image (docling’s
generate_page_images, #520 — accepted as an alias).
do_picture_classification: Option<bool>Enrichment: classify pictures with DocumentFigureClassifier (#423).
do_code_enrichment: Option<bool>Enrichment: rewrite code blocks with CodeFormulaV2 (#423).
do_formula_enrichment: Option<bool>Enrichment: decode display formulas to LaTeX with CodeFormulaV2 (#423).
do_picture_ocr: Option<bool>Enrichment: OCR the embedded pictures of non-PDF documents (#645); the text becomes the picture’s description annotation.
picture_ocr_classes: Option<String>Comma-separated DocumentFigureClassifier labels a picture must be classified as to be OCR’d (#645); unset/empty = every picture.
picture_ocr_min_side: Option<u32>Smallest side in px a picture must have to be OCR’d (#645; default
32, DOCLING_RS_PICTURE_OCR_MIN_SIDE).
keep_picture_images: Option<bool>Keep the embedded image bytes on the pictures (#645); false drops
them after the enrichment pass. Default true.
redact_pii: Option<bool>Redact personal data from the converted document before any export.
redact_mode: Option<String>What a span becomes: label (default) | pseudonym | fixed:<text>.
redact_kinds: Option<String>Comma-separated kinds to redact (email,phone,credit_card,iban, ip_address,url_credentials,national_id,person,organization, location,address); unset = every kind.
redact_pattern: Option<String>Extra patterns, NAME=REGEX entries separated by newlines (the CLI
flag repeats); the match (or capture group 1) is redacted as [NAME].
redact_images: Option<String>Embedded images and page renders: drop (default) | box_out | keep.
pipeline: Option<String>standard (default) | vlm (#77): the remote vision model instead of
the local ML stack. The vlm_* options are inert under standard.
vlm_endpoint: Option<String>VLM endpoint; falls back to DOCLING_RS_VLM_ENDPOINT.
vlm_model: Option<String>VLM model name; falls back to DOCLING_RS_VLM_MODEL.
vlm_api_key: Option<String>Bearer token for the endpoint; falls back to DOCLING_RS_VLM_API_KEY.
vlm_prompt: Option<String>Per-page instruction; falls back to DOCLING_RS_VLM_PROMPT.
vlm_max_tokens: Option<usize>max_tokens per completion (default 8192); 0 is rejected.
Implementations§
Source§impl ConvertOptions
impl ConvertOptions
Sourcepub fn image_sources(&self) -> Result<Option<ImageSources>, OptionsError>
pub fn image_sources(&self) -> Result<Option<ImageSources>, OptionsError>
The image tier image_sources names (#646); None when unset (the
fetch_images alias, else the converter’s default, decides).
Sourcepub fn field_names() -> Vec<String>
pub fn field_names() -> Vec<String>
The wire names of every field, from the struct itself (an unset
option serializes as null), so a new field is listed without a
hand-kept list — the inventory test and the unknown-key checks of the
JSON surfaces read it.
Sourcepub fn unknown_keys<'a>(
keys: impl IntoIterator<Item = &'a str>,
also_known: &[&str],
) -> Vec<String>
pub fn unknown_keys<'a>( keys: impl IntoIterator<Item = &'a str>, also_known: &[&str], ) -> Vec<String>
The keys among keys that are neither a field, one of its aliases,
nor in also_known — what a JSON surface that rejects typos (the C
ABI, the wasm module) reports.
Sourcepub fn merge_over(self, base: ConvertOptions) -> ConvertOptions
pub fn merge_over(self, base: ConvertOptions) -> ConvertOptions
self on top of base — see merge_options.
Sourcepub fn validate(&self) -> Result<(), OptionsError>
pub fn validate(&self) -> Result<(), OptionsError>
Check every option that can be checked without the input document —
the one set of rules all surfaces apply, before any work starts:
pages spelling, a positive document_timeout, a positive
ocr_scale, images_scale in 0.1–4.0, a known pipeline, a positive
vlm_max_tokens, and (with the pdf feature, which has the engine
tables) a known ocr_engine / ocr_mode, an ocr_lang the
selected engine reads and picture_ocr_classes the classifier
predicts. asr_lang, encoding and ebcdic_layout are
checked against the model / codec / copybook when the conversion runs.
Sourcepub fn picture_ocr_classes(&self) -> Result<Vec<String>, OptionsError>
pub fn picture_ocr_classes(&self) -> Result<Vec<String>, OptionsError>
The parsed picture_ocr_classes (#645): the comma-separated labels,
trimmed and lower-cased, empty when unset. With the pdf feature
(which has the classifier’s label table) a label the
DocumentFigureClassifier never predicts is rejected — a typo would
otherwise silently skip every picture.
Sourcepub fn redaction(&self) -> Result<Option<RedactionOptions>, OptionsError>
pub fn redaction(&self) -> Result<Option<RedactionOptions>, OptionsError>
The parsed PII redaction request (#621): None unless redact_pii
is set; the mode, kinds, patterns and image mode checked — an
unknown spelling or an invalid regex is rejected here, naming the
field, rather than failing the conversion.
Sourcepub fn apply(
&self,
c: DocumentConverter,
) -> Result<DocumentConverter, OptionsError>
pub fn apply( &self, c: DocumentConverter, ) -> Result<DocumentConverter, OptionsError>
Validate, then set every given option on base — unset ones leave the
base’s values (so a surface may pre-configure defaults of its own,
e.g. docling-serve’s --strict). DocumentConverter::from_options
is this on a fresh converter.
Sourcepub fn page_range(&self) -> Result<Option<(usize, usize)>, OptionsError>
pub fn page_range(&self) -> Result<Option<(usize, usize)>, OptionsError>
pages parsed (crate::parse_page_range); None when unset.
Sourcepub fn document_timeout(&self) -> Result<Option<Duration>, OptionsError>
pub fn document_timeout(&self) -> Result<Option<Duration>, OptionsError>
document_timeout as a duration; None when unset.
Sourcepub fn pipeline(&self) -> Result<PipelineKind, OptionsError>
pub fn pipeline(&self) -> Result<PipelineKind, OptionsError>
The pipeline the options select.
Sourcepub fn enrichments(&self) -> EnrichmentOptions
pub fn enrichments(&self) -> EnrichmentOptions
The enrichment passes (#423) — unset and false both mean off.
Sourcepub fn ocr_engine(&self) -> Result<Option<OcrEngine>, OptionsError>
pub fn ocr_engine(&self) -> Result<Option<OcrEngine>, OptionsError>
ocr_engine parsed; None when unset (the process default applies).
Sourcepub fn effective_ocr_engine(&self) -> Result<OcrEngine, OptionsError>
pub fn effective_ocr_engine(&self) -> Result<OcrEngine, OptionsError>
The engine ocr_lang is read against: ocr_engine, else the process
default (DOCLING_RS_OCR_ENGINE, else PP-OCR).
Sourcepub fn ocr_lang(&self) -> Result<Option<OcrLang>, OptionsError>
pub fn ocr_lang(&self) -> Result<Option<OcrLang>, OptionsError>
ocr_lang validated against the engine (#460) and, under PP-OCR, the
recognition model it selects; None when unset or under Tesseract
(whose language list is Self::tesseract_lang).
Sourcepub fn tesseract_lang(&self) -> Result<Option<String>, OptionsError>
pub fn tesseract_lang(&self) -> Result<Option<String>, OptionsError>
Tesseract’s -l argument from ocr_lang (#460); None under PP-OCR
or without a language.
Sourcepub fn ocr_disabled(&self) -> bool
pub fn ocr_disabled(&self) -> bool
Whether OCR is off: no_ocr or its pre-2.0 name skip_ocr (#611).
What a surface that builds the PDF pipeline itself reads.
Sourcepub fn ocr_mode(&self) -> Result<Option<OcrMode>, OptionsError>
pub fn ocr_mode(&self) -> Result<Option<OcrMode>, OptionsError>
ocr_mode parsed (#254); None when unset.
Sourcepub fn image_output(&self) -> ImageOutput
pub fn image_output(&self) -> ImageOutput
Picture-crop scale and page images for the pipeline (#519/#520).
Sourcepub fn vlm_options(&self) -> Result<Option<VlmOptions>, OptionsError>
pub fn vlm_options(&self) -> Result<Option<VlmOptions>, OptionsError>
The remote-VLM configuration (#77) when pipeline is vlm, resolved
against the DOCLING_RS_VLM_* environment the way every surface did
on its own before: endpoint and model from the options else the env
(blank counts as unset), the prompt and API key likewise, pages
composing like it does with the ML pipeline. None under the standard
pipeline — the vlm_* options are then ignored, not rejected (the
bindings’ long-standing contract).
Trait Implementations§
Source§impl Clone for ConvertOptions
impl Clone for ConvertOptions
Source§impl Debug for ConvertOptions
impl Debug for ConvertOptions
Source§impl Default for ConvertOptions
impl Default for ConvertOptions
Source§impl<'de> Deserialize<'de> for ConvertOptionswhere
ConvertOptions: Default,
impl<'de> Deserialize<'de> for ConvertOptionswhere
ConvertOptions: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ConvertOptions
impl PartialEq for ConvertOptions
Source§impl Serialize for ConvertOptions
impl Serialize for ConvertOptions
impl StructuralPartialEq for ConvertOptions
Auto Trait Implementations§
impl Freeze for ConvertOptions
impl RefUnwindSafe for ConvertOptions
impl Send for ConvertOptions
impl Sync for ConvertOptions
impl Unpin for ConvertOptions
impl UnsafeUnpin for ConvertOptions
impl UnwindSafe for ConvertOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().