diff --git a/CHANGELOG b/CHANGELOG index ab63aa9d5..b67b967f6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ Deprecations (DEP): - PyPDF2 2.0 requires Python 3.6+. Python 2.7 and 3.5 support were dropped. - PdfFileReader and PdfFileMerger no longer have the `overwriteWarnings` parameter. The new behavior is `overwriteWarnings=False`. +- merger: OutlinesObject was removed. - utils: * `formatWarning` was removed * `isInt(obj)`: Use `instance(obj, int)` instead diff --git a/PyPDF2/merger.py b/PyPDF2/merger.py index b790b7b55..498158e64 100644 --- a/PyPDF2/merger.py +++ b/PyPDF2/merger.py @@ -600,46 +600,3 @@ def addNamedDestination(self, title, pagenum): NumberObject(826), ) self.named_dests.append(dest) - - -class OutlinesObject(list): - def __init__(self, pdf, tree, parent=None): - list.__init__(self) - self.tree = tree - self.pdf = pdf - self.parent = parent - - def remove(self, index): - obj = self[index] - del self[index] - self.tree.removeChild(obj) - - def add(self, title, pagenum): - page_ref = self.pdf.getObject(self.pdf._pages)[PA.KIDS][pagenum] - action = DictionaryObject() - action.update( - { - NameObject("/D"): ArrayObject( - [page_ref, NameObject("/FitH"), NumberObject(826)] - ), - NameObject("/S"): NameObject("/GoTo"), - } - ) - action_ref = self.pdf._addObject(action) - bookmark = TreeObject() - - bookmark.update( - { - NameObject("/A"): action_ref, - NameObject("/Title"): createStringObject(title), - } - ) - - self.pdf._addObject(bookmark) - - self.tree.addChild(bookmark) - - def removeAll(self): - for child in self.tree.children(): - self.tree.removeChild(child) - self.pop()