Skip to content

Commit

Permalink
Update text.py
Browse files Browse the repository at this point in the history
Fixing issue jsvine#1159 that opend by me (:
  • Loading branch information
iiAmeer authored Aug 15, 2024
1 parent e2a707b commit 80bad6c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pdfplumber/utils/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,16 @@ def to_string(self) -> str:
return base
else:
lines = base.split("\n")
for line in lines:
try:
int(line)
except:
continue
if ld in ("btt", "rtl"):
lines = list(reversed(lines))

if cd == "rtl":
lines = ["".join(reversed(line)) for line in lines]
lines = ["".join(reversed(line) if not line.isdigit() else line) for line in lines]

if ld in ("rtl", "ltr"):
max_line_length = max(map(len, lines))
Expand Down

0 comments on commit 80bad6c

Please sign in to comment.