File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -469,14 +469,16 @@ def ffsize_same(a,b):
469
469
'- ' , '' ) for t in text_areas ['blocks' ] if 'lines' in t ]
470
470
471
471
############################## <第 2 步,获取正文主字体> ##################################
472
- fsize_statiscs = {}
473
- for span in meta_span :
474
- if span [1 ] not in fsize_statiscs : fsize_statiscs [span [1 ]] = 0
475
- fsize_statiscs [span [1 ]] += span [2 ]
476
- main_fsize = max (fsize_statiscs , key = fsize_statiscs .get )
477
- if REMOVE_FOOT_NOTE :
478
- give_up_fize_threshold = main_fsize * REMOVE_FOOT_FFSIZE_PERCENT
479
-
472
+ try :
473
+ fsize_statiscs = {}
474
+ for span in meta_span :
475
+ if span [1 ] not in fsize_statiscs : fsize_statiscs [span [1 ]] = 0
476
+ fsize_statiscs [span [1 ]] += span [2 ]
477
+ main_fsize = max (fsize_statiscs , key = fsize_statiscs .get )
478
+ if REMOVE_FOOT_NOTE :
479
+ give_up_fize_threshold = main_fsize * REMOVE_FOOT_FFSIZE_PERCENT
480
+ except :
481
+ raise RuntimeError (f'抱歉, 我们暂时无法解析此PDF文档: { fp } 。' )
480
482
############################## <第 3 步,切分和重新整合> ##################################
481
483
mega_sec = []
482
484
sec = []
You can’t perform that action at this time.
0 commit comments