From 51e1de5714eb8fc3b06d2759c2cb0fd12a17a9f4 Mon Sep 17 00:00:00 2001 From: Stefan <96178532+stefan6419846@users.noreply.github.com> Date: Fri, 20 Dec 2024 14:41:04 +0100 Subject: [PATCH] keep coverage for now Co-authored-by: pubpub-zz <4083478+pubpub-zz@users.noreply.github.com> --- pypdf/_page.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/pypdf/_page.py b/pypdf/_page.py index 6e98658fa..c13422392 100644 --- a/pypdf/_page.py +++ b/pypdf/_page.py @@ -1980,21 +1980,12 @@ def process_operation(operator: bytes, operands: List[Any]) -> None: memo_tm = tm_matrix.copy() # Table 5.2 page 398 elif operator == b"Tz": - if operands: - char_scale = float(operands[0]) / 100.0 - else: - char_scale = 1.0 + char_scale = float(operands[0]) / 100.0 if operands else 1.0 elif operator == b"Tw": - if operands: - space_scale = 1.0 + float(operands[0]) - else: - space_scale = 1.0 + space_scale = 1.0 + float(operands[0] if operands else 0.0) elif operator == b"TL": - if operands: - scale_x = math.sqrt(tm_matrix[0]**2 + tm_matrix[2]**2) - TL = float(operands[0]) * font_size * scale_x - else: - TL = 0.0 + scale_x = math.sqrt(tm_matrix[0]**2 + tm_matrix[2]**2) + TL = float(operands[0] if operands else 0.0) * font_size * scale_x elif operator == b"Tf": if text != "": output += text # .translate(cmap)