'Retrieves the document outline present in the document.
:return: a nested list of :class:`Destinations<PyPDF2.generic.Destination>`.'

def getOutlines(self, node=None, outlines=None):

    if (outlines == None):
        outlines = []
        catalog = self.trailer['/Root']
        if ('/Outlines' in catalog):
            try:
                lines = catalog['/Outlines']
            except utils.PdfReadError:
                return outlines
            if ('/First' in lines):
                node = lines['/First']
        self._namedDests = self.getNamedDestinations()
    if (node == None):
        return outlines
    while True:
        outline = self._buildOutline(node)
        if outline:
            outlines.append(outline)
        if ('/First' in node):
            subOutlines = []
            self.getOutlines(node['/First'], subOutlines)
            if subOutlines:
                outlines.append(subOutlines)
        if ('/Next' not in node):
            break
        node = node['/Next']
    return outlines
