Skip to main content
paddleocr/pp-ocrv6 returns a box for every word, grouped under its line, when you set method_params.word_boxes to true. Boxes are normalized to the page (0 to 1), so they map onto the original PDF or image at any resolution.
Word boxes are opt-in and add nothing to the price: a request bills the same with or without them.

Request

Send an image or a PDF with method: "ocr". JSON mode is the easiest to parse; text mode carries the same words.

Response

PDF

Each page’s content.items is a flat list of blocks. A line block lists its words in child_ids. Each word block follows its line and names it in parent_id.
To read lines only, keep the blocks with no parent_id.

Image

Each line in content.items carries a words list, in reading order.
bbox_xywh is [x, y, width, height] from the top-left corner. See Response Formats.

Highlight a phrase

Match the phrase against consecutive words on a page, then scale each box by the page size. This example uses PyMuPDF and continues from the Python request above.
A phrase can wrap onto the next line. Matching over the page’s word list, not one line, finds it.

Behavior

Document OCR

Pick a model and read a PDF page by page.

Method parameters

Every method_params key, by model.