Skip to content

Commit 6a333f5

Browse files
committed
Fixed error in font information determination
1 parent f830047 commit 6a333f5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pypdfocr/pypdfocr_pdf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,10 @@ def polyval(self,poly, x):
349349

350350

351351
def _get_font_spec(self, tag):
352-
fontspec = self.regex_fontspec.search(tag).groups()
353-
if fontspec == None or len(fontspec) != 2:
352+
try:
353+
fontspec = self.regex_fontspec.search(tag).groups()
354+
fontname, fontsize = fontspec
355+
except Exception:
354356
fontname = ""
355357
fontsize = 8
356-
else:
357-
fontname, fontsize = fontspec
358358
return (fontname, self._atoi(fontsize))

0 commit comments

Comments
 (0)