Skip to content

Commit 8139af2

Browse files
committed
Update PyMuPDF for changes in MuPDF 1.27.x branch.
1 parent 6591ab7 commit 8139af2

4 files changed

Lines changed: 8 additions & 2 deletions

File tree

docs/vars.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ For the PyMuPDF programmer, some combination (using Python's `|` operator, or si
275275
276276
32768 -- Request collecting text **decoration** properties. This includes text underlining and strikeout. In contrast to public awareness, these are not font properties, but are drawn separately as vector graphics or annotations on top of the text. In addition, the flag bit will also cause MuPDF to detect "fake bold" text. In many cases, Document creators **simulate bold** text by printing the same text multiple times with slight offsets. If this flag is set, such text will be marked as bold in the resulting text spans.
277277

278+
.. py:data:: TEXT_LAZY_VECTORS
279+
280+
1048576 -- Delay vector blocks in the extraction slightly to avoid breaking what would otherwise be continuous lines of text.
281+
278282
The following constants represent the default combinations of the above for text extraction and searching:
279283

280284
.. py:data:: TEXTFLAGS_TEXT

src/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17597,6 +17597,8 @@ def width(self):
1759717597
TEXT_COLLECT_VECTORS = mupdf.FZ_STEXT_COLLECT_VECTORS
1759817598
TEXT_IGNORE_ACTUALTEXT = mupdf.FZ_STEXT_IGNORE_ACTUALTEXT
1759917599
TEXT_SEGMENT = mupdf.FZ_STEXT_SEGMENT
17600+
if mupdf_version_tuple >= (1, 27, 1):
17601+
TEXT_LAZY_VECTORS = mupdf.FZ_STEXT_LAZY_VECTORS
1760017602

1760117603
if mupdf_version_tuple >= (1, 26):
1760217604
TEXT_PARAGRAPH_BREAK = mupdf.FZ_STEXT_PARAGRAPH_BREAK

tests/test_2548.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_2548():
3232
# This checks that PyMuPDF 1.23.7 fixes this bug, and also that earlier
3333
# versions with updated MuPDF also fix the bug.
3434
rebased = hasattr(pymupdf, 'mupdf')
35-
if pymupdf.mupdf_version_tuple >= (1, 28):
35+
if pymupdf.mupdf_version_tuple >= (1, 27, 1):
3636
expected = ''
3737
elif pymupdf.mupdf_version_tuple >= (1, 27):
3838
expected = 'format error: No common ancestor in structure tree\nstructure tree broken, assume tree is missing'

tests/test_textextract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ def get_all_page_from_pdf(document, last_page=None):
387387
assert texts1 == texts0
388388

389389
wt = pymupdf.TOOLS.mupdf_warnings()
390-
if pymupdf.mupdf_version_tuple >= (1, 28):
390+
if pymupdf.mupdf_version_tuple >= (1, 27, 1):
391391
expected = ''
392392
assert wt == expected
393393
elif pymupdf.mupdf_version_tuple >= (1, 27):

0 commit comments

Comments
 (0)