def _close_pdf(self):
        if self.output_pdf is not None:
            logging.info('Closing output PDF file: %s', str(self.output_pdf._file.fh.name))
            self.output_pdf.close()
            self.output_pdf = None