'Add a bookmark to this PDF file.
:param str title: Title to use for this bookmark.
:param int pagenum: Page number this bookmark will point to.
:param parent: A reference to a parent bookmark to create nested
bookmarks.
:param tuple color: Color of the bookmark as a red, green, blue tuple
from 0.0 to 1.0
:param bool bold: Bookmark is bold
:param bool italic: Bookmark is italic
:param str fit: The fit of the destination page. See
:meth:`addLink()<addLink>` for details.'

def addBookmark(self, title, pagenum, parent=None, color=None, bold=False, italic=False, fit='/Fit', *args):

    pageRef = self.getObject(self._pages)['/Kids'][pagenum]
    action = DictionaryObject()
    zoomArgs = []
    for a in args:
        if (a is not None):
            zoomArgs.append(NumberObject(a))
        else:
            zoomArgs.append(NullObject())
    dest = Destination(NameObject((('/' + title) + '    bookmark')), pageRef, NameObject(fit), *zoomArgs)
    destArray = dest.getDestArray()
    action.update({NameObject('/D'): destArray, NameObject('/S'): NameObject('/GoTo')})
    actionRef = self._addObject(action)
    outlineRef = self.getOutlineRoot()
    if (parent == None):
        parent = outlineRef
    bookmark = TreeObject()
    bookmark.update({NameObject('/A'): actionRef, NameObject('/Title'): createStringObject(title)})
    if (color is not None):
        bookmark.update({NameObject('/C'): ArrayObject([FloatObject(c) for c in color])})
    format = 0
    if italic:
        format += 1
    if bold:
        format += 2
    if format:
        bookmark.update({NameObject('/F'): NumberObject(format)})
    bookmarkRef = self._addObject(bookmark)
    parent = parent.getObject()
    parent.addChild(bookmarkRef, self)
    return bookmarkRef
