mfenniak / pyPdf

Pure-Python PDF Library; this repository is no longer maintained, please see https://github.com/knowah/PyPDF2/ insead.
https://github.com/knowah/PyPDF2/
Other
276 stars 85 forks source link

PdfFileWriter.write() won't return #44

Closed lqhl closed 11 years ago

lqhl commented 11 years ago

Example code:

from pyPdf import PdfFileWriter, PdfFileReader

output = PdfFileWriter()
input1 = PdfFileReader(file("1.pdf", "rb"))

for i in range(input1.getNumPages()):
    output.addPage(input1.getPage(1))

outputStream = file("document-output.pdf", "wb")
output.write(outputStream)
outputStream.close()

Example pdf file can be found here (it's a paper named Sequential hashing: A flexible approach for unveiling significant patterns in high speed networks).

mfenniak commented 11 years ago

I'm no longer maintaining pyPdf, but the project has been forked as pyPdf2 and is being maintained under that new name. (https://github.com/knowah/PyPDF2/)