Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROB: Widths def in cmap calls indirectObject #1719

Merged
merged 1 commit into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 == ""