File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -460,11 +460,11 @@ def build_font_width_map(
460460 # will consider width of char as avg(width)
461461 m = 0
462462 cpt = 0
463- for xx in w :
464- xx_value = xx .get_object ()
465- if xx_value > 0 :
466- m += xx_value
467- cpt += 1
463+ for xx in w :
464+ xx_value = xx .get_object ()
465+ if xx_value > 0 :
466+ m += xx_value
467+ cpt += 1
468468 font_width_map ["default" ] = m / max (1 , cpt )
469469 st = cast (int , ft ["/FirstChar" ])
470470 en = cast (int , ft ["/LastChar" ])
Original file line number Diff line number Diff line change @@ -740,8 +740,11 @@ def _get_inline_images(self) -> dict[str, ImageFile]:
740740 if k in {"/Length" , "/L" }: # no length is expected
741741 continue
742742 if isinstance (v , list ):
743- value_for_init = ArrayObject (
744- [self ._translate_value_inline_image (k , x ) for x in v ]
743+ value_for_init = cast (
744+ PdfObject ,
745+ ArrayObject (
746+ [self ._translate_value_inline_image (k , x ) for x in v ]
747+ ),
745748 )
746749 else :
747750 value_for_init = self ._translate_value_inline_image (k , v )
Original file line number Diff line number Diff line change @@ -64,7 +64,10 @@ def __post_init__(self) -> None:
6464 for d_font_idx , d_font in enumerate (
6565 self .font_dictionary ["/DescendantFonts" ]
6666 ):
67- d_font_object = d_font .get_object ()
67+ if isinstance (d_font , IndirectObject ):
68+ d_font_object = d_font .get_object ()
69+ else :
70+ d_font_object = d_font
6871 assert not isinstance (d_font_object , IndirectObject ), d_font_object
6972 self .font_dictionary ["/DescendantFonts" ][d_font_idx ] = d_font_object
7073 ord_map = {
You can’t perform that action at this time.
0 commit comments