[Tutor] New newbie question.

SA sarmstrong13@mac.com
Tue, 09 Jul 2002 14:52:55 -0500


On 7/9/02 2:27 PM, "Danny Yoo" <dyoo@hkn.eecs.berkeley.edu> wrote:

> 
> On Tue, 9 Jul 2002, SA wrote:
> 
>> Can you read a pdf with Python?
>> 
>> I know you can read a text file with:
>> 
>> Inp = open("textfile", "r")
>> 
>> Will the same thing work on pdf files:
>> 
>> Inp = open("pdffile", "rb")
> 
> Yes, we can read from pdf's in binary format.
> 

The only problem is when I try to read a pdf file using "rb", python then
displays a lot of pdf jibberish instead of the text that is in the pdf file
on the next web page.
Is there something else I need to do to read the text lines with this
method, or do I need to just skip this and try to use pdftotxt program
instead?

Thanks.
SA