Skip to content

Instantly share code, notes, and snippets.

import json
from lxml import etree
def create_hocr_document(target_page_bbox, lines):
# Create the root <html> element with namespaces and language attributes
XML_NS = "http://www.w3.org/XML/1998/namespace"
# Create the <html> element with attributes