Skip to content

Commit

Permalink
Fix tabby page slice parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
sunveil committed Nov 21, 2023
1 parent d535b23 commit 9235cd5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ def __extract(self, path: str, parameters: dict, warnings: list)\

# in java tabby reader page numeration starts with 1, end_page is included
first_tabby_page = first_page + 1 if first_page is not None else 1
last_tabby_page = None if last_page is not None and last_page > page_count else last_page
last_tabby_page = page_count if (last_page is None) or (last_page is not None and last_page > page_count) else last_page
self.logger.info(f"Reading PDF pages from {first_tabby_page} to {last_tabby_page}")
document = self.__process_pdf(path=path, start_page=first_tabby_page, end_page=last_tabby_page)

pages = document.get("pages", [])
for page in pages[first_page:last_page]:
for page in pages:
page_lines = self.__get_lines_with_location(page, file_hash)
if page_lines:
all_lines.extend(page_lines)
Expand Down

0 comments on commit 9235cd5

Please sign in to comment.