Skip to content

Commit

Permalink
Merge branch 'release/0.0.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
ja573 committed Jan 15, 2025
2 parents b891385 + b96c56b commit d06e8a1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ def merge_pdfs(self, page_range, output_file_name):

try:
original_pdf = fitz.open(self.input_file)
real_page_range = [original_pdf.get_page_numbers(p, only_one=True)[0]
for p in page_range]
try:
real_page_range = [original_pdf.get_page_numbers(p, only_one=True)[0]
for p in page_range]
except IndexError:
print(f"Error: Could not find page labels for page_range: {page_range}")
print(f"Original PDF page count: {len(original_pdf)}")
raise

chapter_pdf = fitz.open()
labels = []
Expand Down

0 comments on commit d06e8a1

Please sign in to comment.