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 withmethod: "ocr". JSON mode is the easiest to parse; text mode carries the same words.
Response
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.
parent_id.
Image
Each line incontent.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.Behavior
Related
Document OCR
Pick a model and read a PDF page by page.
Method parameters
Every
method_params key, by model.