()
| 186 | |
| 187 | |
| 188 | def test_3780(): |
| 189 | path = os.path.normpath(f'{__file__}/../../tests/resources/test_3780.pdf') |
| 190 | with pymupdf.open(path) as document: |
| 191 | for page_i, page in enumerate(document): |
| 192 | for itm in page.get_fonts(): |
| 193 | buff=document.extract_font(itm[0])[-1] |
| 194 | font=pymupdf.Font(fontbuffer=buff) |
| 195 | print(f'{page_i=}: xref {itm[0]} {font.name=} {font.ascender=} {font.descender=}.') |
| 196 | if page_i == 0: |
| 197 | d = page.get_text('dict') |
| 198 | #for n, v in d.items(): |
| 199 | # print(f' {n}: {v!r}') |
| 200 | for i, block in enumerate(d['blocks']): |
| 201 | print(f'block {i}:') |
| 202 | if block['type'] != 0: |
| 203 | continue |
| 204 | for j, line in enumerate(block['lines']): |
| 205 | print(f' line {j}:') |
| 206 | for k, span in enumerate(line['spans']): |
| 207 | print(f' span {k}:') |
| 208 | for n, v in span.items(): |
| 209 | print(f' {n}: {v!r}') |
| 210 | |
| 211 | |
| 212 | def test_3887(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…