From: Lee Harr on

> 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
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
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?
First  |  Prev  | 
Pages: 1 2
Prev: PyODBC Stored proc calling
Next: win32com.client