Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
hirenpopat67 authored Mar 18, 2023
2 parents 684e2ff + 3419429 commit fde732f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pypdf/_cmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def compute_space_width(
w = []
while len(w) > 0:
st = w[0]
second = w[1]
second = w[1].get_object()
if isinstance(second, int):
for x in range(st, second):
w1[x] = w[2]
Expand Down
10 changes: 10 additions & 0 deletions tests/test_cmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,13 @@ def test_iss1533():
reader = PdfReader(BytesIO(get_pdf_from_url(url, name=name)))
reader.pages[0].extract_text() # no error
assert build_char_map("/F", 200, reader.pages[0])[3]["\x01"] == "Ü"


@pytest.mark.enable_socket()
def test_iss1718(caplog):
url = "https://github.com/py-pdf/pypdf/files/10983477/Ballinasloe_WS.pdf"
name = "iss1718.pdf"
reader = PdfReader(BytesIO(get_pdf_from_url(url, name=name)))
for p in reader.pages:
_txt = p.extract_text()
assert caplog.text == ""

0 comments on commit fde732f

Please sign in to comment.