Skip to content

Commit

Permalink
BUG : write reuse
Browse files Browse the repository at this point in the history
fix #1338
  • Loading branch information
pubpub-zz committed Sep 27, 2022
1 parent c6ac1e2 commit f9d7d19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions PyPDF2/_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,14 @@ def __init__(self, fileobj: StrByteType = "") -> None:
self._info = self._add_object(info)

# root object
root = DictionaryObject()
root.update(
self._root_object = DictionaryObject()
self._root_object.update(
{
NameObject(PA.TYPE): NameObject(CO.CATALOG),
NameObject(CO.PAGES): self._pages,
}
)
self._root: Optional[IndirectObject] = None
self._root_object = root
self._root = self._add_object(self._root_object)
self.fileobj = fileobj
self.with_as_usage = False

Expand Down
Binary file modified resources/Seige_of_Vicksburg_Sample_OCR-crazyones-merged.pdf
Binary file not shown.

0 comments on commit f9d7d19

Please sign in to comment.