Skip to content

Commit

Permalink
Merge branch 'main' into add_reattach_fields
Browse files Browse the repository at this point in the history
  • Loading branch information
pubpub-zz authored Feb 28, 2024
2 parents 9060ec5 + 40e3843 commit 99938f4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def merge():

outline_item = writer.add_outline_item("An outline item", 0)
writer.add_outline_item("deeper", 0, parent=outline_item)
writer.add_metadata({"author": "Martin Thoma"})
writer.add_metadata({"/Author": "Martin Thoma"})
writer.add_named_destination("title", 0)
writer.set_page_layout("/SinglePage")
writer.page_mode = "/UseThumbs"
Expand Down Expand Up @@ -133,10 +133,11 @@ def test_merge(benchmark):


def text_extraction(pdf_path):
reader = PdfReader(pdf_path)
text = ""
for page in reader.pages:
text += page.extract_text()
with open(pdf_path, mode="rb") as fd:
reader = PdfReader(fd)
text = ""
for page in reader.pages:
text += page.extract_text()
return text


Expand Down

0 comments on commit 99938f4

Please sign in to comment.