Coverage for lino/utils/pdf.py : 38%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: UTF-8 -*- # Copyright 2013 Luc Saffre # License: BSD (see file COPYING for details)
#~ needs pyPdf, see http://pybrary.net/pyPdf #~ from pyPdf import PdfFileWriter, PdfFileReader
output = pyPdf.PdfFileWriter()
for input_name in pdfs: input = pyPdf.PdfFileReader(file(input_name, "rb")) #~ print "%s has %s pages." % (input_name, input.getNumPages()) for page in input.pages: output.addPage(page)
outputStream = file(output_name, "wb") output.write(outputStream) outputStream.close() |