PaddleOCR Document Parsing and Intelligent Text Recognition

July 19, 2026 · View on GitHub

Overview

PaddleOCR is an OCR and document intelligence toolkit in the Baidu PaddlePaddle ecosystem. It covers general text recognition, document layout analysis, table parsing, formula recognition, and other capabilities for common document-processing scenarios such as scanned documents, photographed documents, multi-page PDFs, and technical documents.

X-AnyLabeling integrates these capabilities through a dedicated PaddleOCR panel for document understanding and intelligent text recognition workflows. The panel supports layout parsing, text recognition, formula recognition, and table recognition for images and PDF files. After parsing is complete, you can review, edit, copy, and export the recognized results.

Two service modes are supported: you can call the official PaddleOCR API directly, or connect to a PaddleOCR model served through an X-AnyLabeling-compatible remote inference service. Parsed results are saved as local JSON files and displayed in the interface together with source-file regions, structured content, and editable result blocks.

Model Configuration

The X-AnyLabeling client supports the official PaddleOCR API by default, so you do not need to deploy an additional inference service. When the PaddleOCR panel is opened for the first time and no API information has been configured, the PPOCR API Settings dialog appears automatically. Enter the corresponding API_KEY to enable official API parsing. To update the configuration later, click the gear button at the top of the right-side result panel.

The following official API model options are currently supported in the parsing-model drop-down list:

  • PaddleOCR-VL-1.6 (API)
  • PaddleOCR-VL (API)

To obtain the required API information:

  1. Visit the PaddleOCR website.
  2. Open the API call example, switch to the Async Parse tab, and copy the API_KEY.
  3. Return to PPOCR API Settings in X-AnyLabeling, paste the key, and confirm.

The configuration is saved locally:

${workspace}/xanylabeling_data/paddleocr/api_settings.json

By default, ${workspace} is the user's home directory, ~. If X-AnyLabeling is started with --work-dir, that directory is used instead.

Local Deployment (Optional)

To run PaddleOCR locally or in a private environment, deploy an inference service with X-AnyLabeling-Server. See the multi-task OCR example for dependency installation and startup instructions.

Make sure X-AnyLabeling-Server has been updated to the latest version, and check that the ppocr_layoutstructv3_vl_1_5 model configuration is available. If you want to implement and integrate your own PaddleOCR inference pipeline, declare the following capability flag in the model configuration. The client uses this flag to determine whether the model can be used in the PaddleOCR panel:

...
capabilities:
  ppocr_pipeline: true
...

After the service starts, reopen the PaddleOCR annotation panel. The Parsing Model drop-down list at the top right displays the available models. Selecting a model without the (API) suffix sends parsing requests to the deployed inference service.

User Guide

You can open PaddleOCR in either of the following ways: click the PaddleOCR icon in the left toolbar, or use the Ctrl+4 shortcut.

After the panel opens, click + New Parsing at the top of the left panel to select files. Confirm Start Parsing to import them; confirmed files are copied to the local PaddleOCR workspace and added to the parsing queue.

The X-AnyLabeling PaddleOCR panel currently supports the following file types:

TypeExtensions
PDF document.pdf
Image.bmp, .cif, .gif, .jpeg, .jpg, .png, .tif, .tiff, .webp

PDF files are first rendered locally into per-page PNG previews. Official API parsing submits the original PDF once through Async Jobs, while remote-service parsing continues to use the local preview pages. For multi-page PDFs, the page count, preview images, and recognition results are all retained in the local workspace.

Tip

  • Hold Ctrl and scroll the mouse wheel in the source-file preview area to zoom the preview page quickly.
  • Click any block in the left preview area or the right result area to match and highlight the corresponding content on both sides.
  • Double-click a block in the right-side recognition result area, or click the block's Correct button, to enter edit mode.
  • Hover over a block in the source-file preview area and click the floating Copy button to copy that block's content.
  • For multi-page PDFs, use the page controls at the bottom to jump between pages, or scroll through the page-separated parsing results in the right result area.
  • After you manually correct recognition results, the edited blocks are recorded in the JSON file. To fetch model results again, use the reparse button on the right.

Note

  • The official PaddleOCR API requires a valid API_KEY. If the API returns 401, check whether the key is valid.
  • Remote-service models appear in the model drop-down list only when /v1/models returns models with the ppocr_pipeline capability.
  • Imported files are copied to the PaddleOCR workspace. Deleting the original external file does not affect the imported copy.

Interface Layout

Overall Layout

The PaddleOCR panel consists of three main areas:

AreaDescription
Left file navigation panelImport files, view recent files, view favorites, search, filter, and delete files
Middle source-file preview areaDisplay images or PDF pages with PaddleOCR layout blocks, polygon boxes, and category colors overlaid
Right parsing result areaSwitch between Document parsing and JSON views, and copy, download, reparse, or edit recognized blocks

Note

The colored dot in the lower-left corner of each file item in the left navigation panel indicates the parsing status:

  • Blue means pending or parsing.
  • Green means parsing completed.
  • Red means parsing failed.

Components

LocationButton/ComponentFunction
Top left+ New ParsingSelect images or PDFs, then confirm to import and start parsing
Left navigationRecentShow recently imported and parsed files
Left navigationFavoritesShow favorited files only
Left navigationSearch buttonExpand the filename search box
Left navigationFilter buttonFilter by sorting rule, file type, and parsing status
Left file itemStar buttonAdd or remove the current file from favorites
Left file itemDelete buttonDelete the source file, JSON file, PDF preview pages, block screenshots, and other related data
Middle page barLeft/right arrowsSwitch to the previous or next PDF page
Middle page barPage number inputJump to a specific PDF page
Middle page barZoom out / zoom in buttonsZoom the source-file preview area
Middle page barReset zoom buttonRestore the preview scale to fit width
Source-file preview areaFloating CopyCopy the content of the currently hovered block
Top rightParsing ModelSelect an official (API) model or a remote PaddleOCR model
Right viewDocument parsingView layout blocks, text, formulas, tables, and images as cards
Right viewJSONView the complete JSON result for the current file
Right toolsGear buttonConfigure the official PaddleOCR API_KEY
Right toolsReparse buttonReparse the current file
Right toolsCopy buttonCopy Markdown content in the document view, or copy JSON in the JSON view
Right toolsDownload buttonDownload a ZIP file in the document view, or download JSON in the JSON view
Result block cardCopyCopy the content of a single block
Result block cardCorrectEnter edit mode for the current block
Parsing bannerCancel ParsingCancel the current batch parsing task
Parsing-failed bannerCopy LogCopy the error log
Parsing-failed bannerReparseReparse the failed file

Parsed Blocks and Editors

After parsing is complete, the right-side Document parsing view displays blocks in layout order. Different block types use different colors:

TypeExample LabelsColor Meaning
Texttext, doc_title, paragraph_title, footer, seal, etc.Blue
TabletableGreen
Imageimage, chart, header_image, footer_imagePurple
HeaderheaderLight purple
Formuladisplay_formula, formula, formula_number, algorithmYellow
Edited blockAny blockOrange border or edit-state marker

The following editors are currently supported:

EditorTrigger ScenarioDescription
Rich text editorPlain text, titles, footers, seals, and other non-table or non-formula contentSupports basic rich text editing and saves the result as Markdown/text content
LaTeX formula editordisplay_formula, formula, formula_number, algorithmSupports editing LaTeX source and renders a live preview below
Table editortable or content recognized as a table structureSupports cell editing, selection copying, adding and deleting rows or columns, and basic text styling

Warning

If an item contains many formulas, the first time you open it or scroll to the corresponding result block may take a short while. This is mainly caused by formula preview rendering. Rendered results are cached, so the same content does not need to be rendered again on subsequent loads.

Data Storage and Directory Structure

The PaddleOCR panel saves imported files and parsed results in the local workspace:

${workspace}/xanylabeling_data/paddleocr/
├── api_settings.json
├── ui_state.json
├── files/
│   ├── example.pdf
│   ├── image.png
│   ├── __PDF_example/
│   │   ├── page_001.png
│   │   └── page_002.png
│   └── __BLOCK_IMAGES_image.png/
│       └── page_001_block_0001.png
└── jsons/
    ├── example.pdf.json
    └── image.png.json
PathDescription
api_settings.jsonCached API_KEY, selected API model, and compatibility API URL for the official PaddleOCR API
ui_state.jsonUI state, such as the list of favorited files
files/Local copies of imported files
files/__PDF_<filename>/Per-page PNG previews rendered from a PDF
files/__BLOCK_IMAGES_<filename>/Local crops for image-type blocks
jsons/<filename>.jsonPaddleOCR parsing results and edited results for the current file

Note

Deleting a file item in the left panel also deletes the source file, local JSON file, PDF preview pages, and block crop images.

JSON Data Structure

Each imported file has a corresponding JSON file. The core structure is as follows:

{
  "layoutParsingResults": [
    {
      "prunedResult": {
        "page_count": 1,
        "width": 1240,
        "height": 1754,
        "model_settings": {
          "pipeline_model": "PaddleOCR-VL-1.6",
          "api_mode": "async_jobs"
        },
        "parsing_res_list": [
          {
            "block_label": "text",
            "block_content": "Recognized text content",
            "block_bbox": [100, 120, 500, 180],
            "block_id": 1,
            "block_order": 1,
            "group_id": 1,
            "global_block_id": 1,
            "global_group_id": 1,
            "block_polygon_points": [
              [100, 120],
              [500, 120],
              [500, 180],
              [100, 180]
            ]
          }
        ]
      },
      "markdown": {
        "text": "Full-page Markdown content",
        "images": {
          "page_1:block_1": "files/__BLOCK_IMAGES_image.png/page_001_block_0001.png"
        }
      },
      "outputImages": {},
      "inputImage": "files/image.png"
    }
  ],
  "preprocessedImages": [],
  "dataInfo": {
    "type": "image",
    "numPages": 1,
    "pages": [
      {
        "width": 1240,
        "height": 1754
      }
    ]
  },
  "_ppocr_meta": {
    "status": "parsed",
    "source_path": "files/image.png",
    "updated_at": "2026-04-18 12:00:00",
    "error_message": "",
    "edited_blocks": [],
    "block_image_paths": {},
    "pipeline_model": "PaddleOCR-VL-1.6",
    "api_mode": "async_jobs",
    "api_job_id": "39373553546153984"
  }
}

Key fields:

FieldDescription
layoutParsingResultsPage-level parsing results. Images usually have one page, while PDFs can have multiple pages
prunedResult.parsing_res_listBlock list for the current page
block_labelBlock type, such as text, table, display_formula, or image
block_contentRecognized content that can be viewed, copied, and edited
block_bboxRectangular bounding box of the block, in [x1, y1, x2, y2] format
block_polygon_pointsPolygon points of the block, used for highlighting in the preview area
markdown.textMarkdown text returned by PaddleOCR or generated by combining blocks
markdown.imagesMapping of image resources referenced in the Markdown
dataInfo.typeFile type. Valid values are image and pdf
dataInfo.numPagesNumber of pages
_ppocr_meta.statusParsing status: pending, parsed, or error
_ppocr_meta.edited_blocksList of block keys that have been manually edited
_ppocr_meta.block_image_pathsLocal resource paths for image-type blocks
_ppocr_meta.pipeline_modelParsing model that generated the result
_ppocr_meta.api_modeOfficial API mode, such as async_jobs
_ppocr_meta.api_job_idOfficial Async Jobs task id, when available

Downloading Results

The download button on the right exports different content depending on the current view:

Current ViewDownloaded Content
Document parsingA ZIP file containing doc_0.md, image resources under imgs/, and layout detection visualizations named layout_det_res_*.jpg
JSONThe complete JSON for the current file. The default filename is <original_filename>_by_<model_name>.json