Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!ecngs!feeder.ecngs.de!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.028 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'myself,': 0.09; 'output': 0.10; 'developer': 0.12; 'method.': 0.15; 'python?': 0.15; 'adam': 0.16; 'from:addr:awilliam': 0.16; 'from:addr:whitemice.org': 0.16; 'from:name:adam tauno williams': 0.16; 'received:72.14.190': 0.16; 'received:72.14.190.87': 0.16; 'received:mail.wmmi.net': 0.16; 'received:wmmi.net': 0.16; 'reply-to:addr:awilliam': 0.16; 'reply- to:addr:whitemice.org': 0.16; 'wrote:': 0.16; 'convert': 0.19; 'jan': 0.19; "haven't": 0.20; 'header:In-Reply-To:1': 0.22; 'extract': 0.24; 'sat,': 0.25; 'pm,': 0.26; 'bit': 0.28; 'script': 0.28; 'received:72.14': 0.29; 'class': 0.29; 'at.': 0.30; 'chris': 0.30; 'yet': 0.32; 'it.': 0.33; 'to:addr:python-list': 0.33; 'there': 0.33; 'this.': 0.33; 'loop': 0.34; 'file.': 0.34; 'file': 0.35; 'url:python': 0.36; 'using': 0.37; 'happens': 0.37; 'hoping': 0.38; 'received:192': 0.38; 'url:org': 0.39; 'received:192.168.1': 0.39; 'subject:: ': 0.39; 'to:addr:python.org': 0.40; 'url:us': 0.60; 'adobe': 0.63; 'williams': 0.63; 'header:Reply-To:1': 0.71; 'reply-to:no real name:2**0': 0.72; 'investor': 0.77; 'hanging': 0.84; 'pdf.': 0.84; 'subject:Adobe': 0.84; 'subject:PDF': 0.84; 'prone': 0.91 Subject: Re: Reading Adobe PDF File From: Adam Tauno Williams To: python-list@python.org Date: Mon, 30 Jan 2012 08:22:13 -0500 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.1 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: awilliam@whitemice.org List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1327929838 news.xs4all.nl 6931 [2001:888:2000:d::a6]:43601 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19599 On Sat, 2012-01-28 at 21:59 -0800, Chris Rebert wrote: > On Sat, Jan 28, 2012 at 9:52 PM, Shrewd Investor wrote: > > I have a very large Adobe PDF file. I was hoping to use a script to > > extract the information for it. Is there a way to loop through a PDF > > file using Python? > Haven't used it myself, but: > http://www.unixuser.org/~euske/python/pdfminer/ It is very prone to hanging and/or crashing. I haven't yet found a really reliably way to read text from a PDF. PyPDF provides a PdfFileReader class with an extractText method. The output is indeed the text although it can be a bit thorny to look at. > > Or do I need to find a way to convert a PDF file into a text file? If > > so how? > The pdf2txt.py script from the same package happens to do exactly this. -- System & Network Administrator [ LPI & NCLA ] OpenGroupware Developer Adam Tauno Williams