Skip to content

Update table.py #4517

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -2348,7 +2348,10 @@ def page_rotation_reset(page, xref, rot, mediabox):

def find_tables(
page,
*, # ← forces keyword use
clip=None,
header_margin: float = 0,
footer_margin: float = 0,
vertical_strategy: str = "lines",
horizontal_strategy: str = "lines",
vertical_lines: list = None,
Expand Down Expand Up @@ -2376,6 +2379,10 @@ def find_tables(
global CHARS, EDGES
CHARS = []
EDGES = []
if clip is None and (header_margin or footer_margin):
clip = Rect(page.rect)
clip.y0 += header_margin
clip.y1 -= footer_margin
old_small = bool(TOOLS.set_small_glyph_heights()) # save old value
TOOLS.set_small_glyph_heights(True) # we need minimum bboxes
if page.rotation != 0:
Expand Down
Loading