Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
File IO errors with PyPDF
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="John Henry, post: 2749162"] Hi list, I am having trouble with PyPDF (tried earlier as well as latest version 1.9). I am using it to combine a number of single page PDF files into one. It works perfectly for up to 8 files but after that, I get a "too many files opened" message. My code goes somewhat like: PdfOutput = PdfFileWriter() ofile = ...name of the combined pdf... for doc_file in (....a bunch of single page pdf files...) inp=file(doc_file, "rb") PdfOutput.addPage(PdfFileReader(inp).getPage(0)) inp.close() outputStream = file(ofile, "wb") PdfOutput.write(outputStream) outputStream.close() As you can see, I closed each one of the files before proceeding and yet I get the "too many files opened" exception. In addition, sometimes I get a "file already closed" message from the .write function even when the number of files are small (like 5). Anybody has any suggestions? If not, do you have recommendations for alternative package? My needs are very simple - I just need to combine the single page pdfs into one. Regards, [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
File IO errors with PyPDF
Top