Skip to content

Commit

Permalink
update page_images method for pdf_document_manager
Browse files Browse the repository at this point in the history
  • Loading branch information
HadronCollider authored May 13, 2024
1 parent 27ba19d commit 69e0b03
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/main/reports/pdf_document/pdf_document_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ def page_images(self, page_without_pril):
page = self.pdf_file[page_num]
images = self.pdf_file.get_page_images(page)
for image in images:
image_coord = page.get_image_bbox(image[7], transform=0)
total_height += (image_coord[3] - image_coord[1])

image_coord = page.get_image_bbox(image[7], transform=0) # might be [1.0, 1.0, -1.0, -1.0]
image_height = image_coord[3] - image_coord[1]
if image_height > 0:
total_height += image_height
return total_height

def page_height(self, page_without_pril):
Expand Down

0 comments on commit 69e0b03

Please sign in to comment.