claird / PyPDF4

A utility to read and write PDFs with Python
obsolete-https://pythonhosted.org/PyPDF2/
Other
328 stars 61 forks source link

Fix DictionaryObject.__init__() #67

Closed S-071 closed 4 years ago

S-071 commented 4 years ago

Adding bookmarks with PdfFileWriter.addBookmark crashes the program and provides the following error.

Traceback (most recent call last):
  File "basic_features.py", line 110, in <module>
    main()
  File "basic_features.py", line 73, in main
    writer.addBookmark("test", 1)
  File "PyPDF4/pypdf/pdf.py", line 824, in addBookmark
    outlineRef = self.getOutlineRoot()
  File "PyPDF4/pypdf/pdf.py", line 703, in getOutlineRoot
    outline = TreeObject()
  File "PyPDF4/pypdf/generic.py", line 737, in __init__
    DictionaryObject.__init__()
TypeError: descriptor '__init__' of 'dict' object needs an argument