rm page number exception for pdf parser (#424)

### What problem does this PR solve?

#423 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
KevinHuSh 2024-04-18 12:09:56 +08:00 committed by GitHub
parent 453c29170f
commit 0499a3f621
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -830,6 +830,7 @@ class HuParser:
pn = [bx["page_number"]]
top = bx["top"] - self.page_cum_height[pn[0] - 1]
bott = bx["bottom"] - self.page_cum_height[pn[0] - 1]
if pn[-1] - 1 >= len(self.page_images): return ""
while bott * ZM > self.page_images[pn[-1] - 1].size[1]:
bott -= self.page_images[pn[-1] - 1].size[1] / ZM
pn.append(pn[-1] + 1)