Skip to content

Commit f97f282

Browse files
authored
Merge pull request #271 from pymupdf/v0.0.24
Version 0.0.24
2 parents 7499678 + 954ffb0 commit f97f282

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

CHANGES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Change Log
22

3+
## Changes in version 0.0.24
4+
5+
### Fixes:
6+
7+
* [270](https://github.com/pymupdf/RAG/issues/270) - Fix UnboundLocalError for table_strategy in pymupdf_rag.py
8+
9+
### Other Changes:
10+
11+
12+
313
## Changes in version 0.0.23
414

515
### Fixes:

pdf4llm/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
"Programming Language :: Python :: 3",
1414
"Topic :: Utilities",
1515
]
16-
requires = ["pymupdf4llm==0.0.23"]
16+
requires = ["pymupdf4llm==0.0.24"]
1717

1818
setuptools.setup(
1919
name="pdf4llm",
20-
version="0.0.23",
20+
version="0.0.24",
2121
author="Artifex",
2222
author_email="support@artifex.com",
2323
description="PyMuPDF Utilities for LLM/RAG",

pymupdf4llm/pymupdf4llm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from .helpers.pymupdf_rag import IdentifyHeaders, to_markdown
22

3-
__version__ = "0.0.23"
3+
__version__ = "0.0.24"
44
version = __version__
55
version_tuple = tuple(map(int, version.split(".")))
66

pymupdf4llm/pymupdf4llm/helpers/pymupdf_rag.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -988,12 +988,12 @@ def get_page_output(
988988
graphics_count = len([b for b in page.get_bboxlog() if "path" in b[0]])
989989
if GRAPHICS_LIMIT and graphics_count > GRAPHICS_LIMIT:
990990
IGNORE_GRAPHICS = True
991-
table_strategy = None
992991

993992
# Locate all tables on page
994993
parms.written_tables = [] # stores already written tables
995994
omitted_table_rects = []
996-
if table_strategy is None:
995+
if IGNORE_GRAPHICS or not table_strategy:
996+
# do not try to extract tables
997997
parms.tabs = None
998998
else:
999999
parms.tabs = page.find_tables(clip=parms.clip, strategy=table_strategy)
@@ -1147,7 +1147,7 @@ def get_page_output(
11471147
toc = doc.get_toc()
11481148

11491149
# Text extraction flags:
1150-
# omit invisible text, collect styles, use accurate bounding boxes
1150+
# omit clipped text, collect styles, use accurate bounding boxes
11511151
textflags = (
11521152
0
11531153
| mupdf.FZ_STEXT_CLIP

pymupdf4llm/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
setuptools.setup(
1919
name="pymupdf4llm",
20-
version="0.0.23",
20+
version="0.0.24",
2121
author="Artifex",
2222
author_email="support@artifex.com",
2323
description="PyMuPDF Utilities for LLM/RAG",

0 commit comments

Comments
 (0)