MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / test_texttrace

Function test_texttrace

tests/test_general.py:276–292  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

274 print( 'test_2173() finished')
275
276def test_texttrace():
277 import time
278 document = pymupdf.Document( f'{scriptdir}/resources/joined.pdf')
279 t = time.time()
280 for page in document:
281 tt = page.get_texttrace()
282 t = time.time() - t
283 print( f'test_texttrace(): t={t!r}')
284
285 # Repeat, this time writing data to file.
286 import json
287 path = f'{scriptdir}/resources/test_texttrace.txt'
288 print( f'test_texttrace(): Writing to: {path}')
289 with open( path, 'w') as f:
290 for i, page in enumerate(document):
291 tt = page.get_texttrace()
292 print( f'page {i} json:\n{json.dumps(tt, indent=" ")}', file=f)
293
294
295def test_2533():

Callers

nothing calls this directly

Calls 1

get_texttraceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…