diff --git a/pypdf/_text_extraction/__init__.py b/pypdf/_text_extraction/__init__.py index ea8adf56c..37af3cd54 100644 --- a/pypdf/_text_extraction/__init__.py +++ b/pypdf/_text_extraction/__init__.py @@ -214,9 +214,10 @@ def handle_tj( rtl_dir: bool, visitor_text: Optional[Callable[[Any, Any, Any, Any, Any], None]], ) -> Tuple[str, bool]: + m = mult(tm_matrix, cm_matrix) orientation = orient(m) - if orientation in orientations: + if orientation in orientations and len(operands) > 0: if isinstance(operands[0], str): text += operands[0] else: