diff --git a/pypdf/_cmap.py b/pypdf/_cmap.py index 03669abe3..74b4f0fe1 100644 --- a/pypdf/_cmap.py +++ b/pypdf/_cmap.py @@ -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] diff --git a/tests/test_cmap.py b/tests/test_cmap.py index 438ca1f40..a371b92fe 100644 --- a/tests/test_cmap.py +++ b/tests/test_cmap.py @@ -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 == ""