'Merge PDF files into one.
:param documents: list of path of pdf files
:returns: path of the merged pdf'

def _merge_pdf(self, documents):

    writer = PdfFileWriter()
    streams = []
    try:
        for document in documents:
            pdfreport = file(document, 'rb')
            streams.append(pdfreport)
            reader = PdfFileReader(pdfreport)
            for page in range(0, reader.getNumPages()):
                writer.addPage(reader.getPage(page))
        (merged_file_fd, merged_file_path) = tempfile.mkstemp(suffix='.pdf', prefix='report.merged.tmp.')
        with closing(os.fdopen(merged_file_fd, 'w')) as merged_file:
            writer.write(merged_file)
    finally:
        for stream in streams:
            try:
                stream.close()
            except Exception:
                pass
    return merged_file_path
