'Returns a new blank page.
If ``width`` or ``height`` is ``None``, try to get the page size
from the last page of *pdf*.
:param pdf: PDF file the page belongs to
:param float width: The width of the new page expressed in default user
space units.
:param float height: The height of the new page expressed in default user
space units.
:return: the new blank page:
:rtype: :class:`PageObject<PageObject>`
:raises PageSizeNotDefinedError: if ``pdf`` is ``None`` or contains
no page'

def createBlankPage(pdf=None, width=None, height=None):

    page = PageObject(pdf)
    page.__setitem__(NameObject('/Type'), NameObject('/Page'))
    page.__setitem__(NameObject('/Parent'), NullObject())
    page.__setitem__(NameObject('/Resources'), DictionaryObject())
    if ((width is None) or (height is None)):
        if ((pdf is not None) and (pdf.getNumPages() > 0)):
            lastpage = pdf.getPage((pdf.getNumPages() - 1))
            width = lastpage.mediaBox.getWidth()
            height = lastpage.mediaBox.getHeight()
        else:
            raise utils.PageSizeNotDefinedError()
    page.__setitem__(NameObject('/MediaBox'), RectangleObject([0, 0, width, height]))
    return page
