'Copy pages from reader to writer. Includes an optional callback parameter
which is invoked after pages are appended to the writer.
:param reader: a PdfFileReader object from which to copy page
annotations to this writer object.  The writer\'s annots
will then be updated
:callback after_page_append (function): Callback function that is invoked after
each page is appended to the writer. Callback signature:
:param writer_pageref (PDF page reference): Reference to the page
appended to the writer.'

def appendPagesFromReader(self, reader, after_page_append=None):

    reader_num_pages = reader.getNumPages()
    writer_num_pages = self.getNumPages()
    for rpagenum in range(0, reader_num_pages):
        reader_page = reader.getPage(rpagenum)
        self.addPage(reader_page)
        writer_page = self.getPage((writer_num_pages + rpagenum))
        if callable(after_page_append):
            after_page_append(writer_page)
