Prev: PyODBC Stored proc calling
Next: win32com.client
From: Lee Harr on 25 Jan 2007 17:41 > Perhaps I'm just using pdftotext wrong? Here's how I was using it: > > sout = os.popen('pdftotext "%s" - ' %f) If you are having trouble with popen (not unlikely) how about just writing to a temporary file and reading the text from there? I've used pdftotext several times in the past few weeks (but not on windows). It was a major time saver for me.
From: Dieter Deyke on 25 Jan 2007 17:54 tubby writes: > David Boddie wrote: > >> The pdftotext tool may do what you want: >> >> http://www.foolabs.com/xpdf/download.html >> >> Let us know how you get on with it. >> >> David > > Perhaps I'm just using pdftotext wrong? Here's how I was using it: > > f = filename > > try: > sout = os.popen('pdftotext "%s" - ' %f) > data = sout.read().strip() > print data > sout.close() > > except Exception, e: > print e I am using pdftotext on Windows with cygwin on a regular basis without any problem. Your program above should read: sout = os.popen('pdftotext "%s" - ' % (f,)) -- Dieter Deyke A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?
From: tubby on 29 Jan 2007 09:06
Dieter Deyke wrote: >> sout = os.popen('pdftotext "%s" - ' %f) > Your program above should read: > > sout = os.popen('pdftotext "%s" - ' % (f,)) What is the significance of doing it this way? |