Skip to main content

Posts

Showing posts from November, 2008

PdfPoster - a simple fix for Windows

I have tried a couple of times over the last 3 months to use PdfPoster on some Erwin documents. Unfortunately, I am using Windows XP on my work PC. It was clearly documented that I needed to install PyPdf 1.11 or higher, so I did easy_setup to install 1.12. Recently, I tried "C:\test>pdfposter -vvv -s 2.0 SCHEDULING.pdf scheduling_2x.pdf" ... and received a nice traceback (see below). This led me on a wild goose chase, under the assumption that my PyPDF library was not installed correctly. After a while, I decided to start python in immediate mode and just exercise PyPdf. It worked fine, but I noticed that the example opened a file using "rb" mode (read only, binary). So, I opened pdfposter/__init__.py under my site library directory, scrolled down to the bottom and changed the 3rd line of "def main" from "inpdf = PdfFileReader(open(infilename))" to "inpdf = PdfFileReader(open(infilename, "rb" ))". Problem solved!