Class ConvertDocumentOptions

java.lang.Object
ai.docling.serve.api.convert.request.options.ConvertDocumentOptions

public class ConvertDocumentOptions extends Object
Options for configuring the document conversion process with Docling.
  • Method Details

    • builder

      public static @NonNull ConvertDocumentOptions.Builder builder()
    • toBuilder

      public @NonNull ConvertDocumentOptions.Builder toBuilder()
    • getFromFormats

      public List<InputFormat> getFromFormats()
      Input format(s) to convert from. String or list of strings. Allowed values: docx, pptx, html, image, pdf, asciidoc, md, csv, xlsx, xml_uspto, xml_jats, mets_gbs, json_docling, audio, vtt. Optional, defaults to all formats.
    • getToFormats

      public List<OutputFormat> getToFormats()
      Output format(s) to convert to. String or list of strings. Allowed values: md, json, html, html_split_page, text, doctags. Optional, defaults to Markdown.
    • getImageExportMode

      public @Nullable ImageRefMode getImageExportMode()
      Image export mode for the document (in case of JSON, Markdown or HTML). Allowed values: placeholder, embedded, referenced. Optional, defaults to Embedded.
    • getDoOcr

      public @Nullable Boolean getDoOcr()
      If enabled, the bitmap content will be processed using OCR. Boolean. Optional, defaults to true.
    • getForceOcr

      public @Nullable Boolean getForceOcr()
      If enabled, replace existing text with OCR-generated text over content. Boolean. Optional, defaults to false.
    • getOcrEngine

      public @Nullable OcrEngine getOcrEngine()
      The OCR engine to use. String. Allowed values: auto, easyocr, ocrmac, rapidocr, tesserocr, tesseract. Optional, defaults to easyocr.
    • getOcrLang

      public List<String> getOcrLang()
      List of languages used by the OCR engine. Note that each OCR engine has different values for the language names. String or list of strings. Optional, defaults to empty.
    • getPdfBackend

      public @Nullable PdfBackend getPdfBackend()
      The PDF backend to use. String. Allowed values: pypdfium2, dlparse_v1, dlparse_v2, dlparse_v4. Optional, defaults to dlparse_v4.
    • getTableMode

      public @Nullable TableFormerMode getTableMode()
      Mode to use for table structure, String. Allowed values: fast, accurate. Optional, defaults to accurate.
    • getTableCellMatching

      public @Nullable Boolean getTableCellMatching()
      If true, matches table cells predictions back to PDF cells. Can break table output if PDF cells are merged across table columns. If false, let table structure model define the text cells, ignore PDF cells.
    • getPipeline

      public @Nullable ProcessingPipeline getPipeline()
      Choose the pipeline to process PDF or image files.
    • getPageRange

      public List<Integer> getPageRange()
      Only convert a range of pages. The page number starts at 1.
    • getDocumentTimeout

      public @Nullable Duration getDocumentTimeout()
      The timeout for processing each document, in seconds.
    • getAbortOnError

      public @Nullable Boolean getAbortOnError()
      Abort on error if enabled. Boolean. Optional, defaults to false.
    • getDoTableStructure

      public @Nullable Boolean getDoTableStructure()
      If enabled, the table structure will be extracted. Boolean. Optional, defaults to true.
    • getIncludeImages

      public @Nullable Boolean getIncludeImages()
      If enabled, images will be extracted from the document. Boolean. Optional, defaults to true.
    • getImagesScale

      public @Nullable Double getImagesScale()
      Scale factor for images. Float. Optional, defaults to 2.0.
    • getMdPageBreakPlaceholder

      public @Nullable String getMdPageBreakPlaceholder()
      Add this placeholder between pages in the markdown output.
    • getDoCodeEnrichment

      public @Nullable Boolean getDoCodeEnrichment()
      If enabled, perform OCR code enrichment. Boolean. Optional, defaults to false.
    • getDoFormulaEnrichment

      public @Nullable Boolean getDoFormulaEnrichment()
      If enabled, perform formula OCR, return LaTeX code. Boolean. Optional, defaults to false.
    • getDoPictureClassification

      public @Nullable Boolean getDoPictureClassification()
      If enabled, classify pictures in documents. Boolean. Optional, defaults to false.
    • getDoPictureDescription

      public @Nullable Boolean getDoPictureDescription()
      If enabled, describe pictures in documents. Boolean. Optional, defaults to false.
    • getPictureDescriptionAreaThreshold

      public @Nullable Double getPictureDescriptionAreaThreshold()
      Minimum percentage of the area for a picture to be processed with the models.
    • getPictureDescriptionLocal

      public @Nullable PictureDescriptionLocal getPictureDescriptionLocal()
      Options for running a local vision-language model in the picture description. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with picture_description_api.
    • getPictureDescriptionApi

      public @Nullable PictureDescriptionApi getPictureDescriptionApi()
      API details for using a vision-language model in the picture description. This parameter is mutually exclusive with picture_description_local.
    • getVlmPipelineModel

      public @Nullable VlmModelType getVlmPipelineModel()
      Preset of local and API models for the vlm pipeline. This parameter is mutually exclusive with vlm_pipeline_model_local and vlm_pipeline_model_api. Use the other options for more parameters.
    • getVlmPipelineModelLocal

      public @Nullable String getVlmPipelineModelLocal()
      Options for running a local vision-language model for the vlm pipeline. The parameters refer to a model hosted on Hugging Face. This parameter is mutually exclusive with vlm_pipeline_model_api and vlm_pipeline_model.
    • getVlmPipelineModelApi

      public @Nullable String getVlmPipelineModelApi()
      API details for using a vision-language model for the vlm pipeline. This parameter is mutually exclusive with vlm_pipeline_model_local and vlm_pipeline_model.
    • toString

      public @NonNull String toString()
      Overrides:
      toString in class Object