Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #62417
| Date | 2013-12-19 21:18 +0000 |
|---|---|
| From | MRAB <python@mrabarnett.plus.com> |
| Subject | Re: PDFMiner install question |
| References | (1 earlier) <mailman.4310.1387312378.18130.python-list@python.org> <89e3b06c-90d7-4cc5-8367-03c916a4dfcb@googlegroups.com> <472d91fe-2ddb-4a78-8a44-6b171f436903@googlegroups.com> <mailman.4313.1387323018.18130.python-list@python.org> <5460059c-c805-40e3-bd3c-ac2ca677f0f7@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4423.1387487928.18130.python-list@python.org> (permalink) |
On 19/12/2013 19:36, Jason Mellone wrote:
> MRAB: Thank you your exact solution worked perfectly.
>
> Now I am trying to run some code from (http://www.unixuser.org/~euske/python/pdfminer/programming.html) under basic usage.
>
> If I try to run
> <code>
> from pdfminer.pdfparser import PDFParser
> from pdfminer.pdfdocument import PDFDocument
> from pdfminer.pdfpage import PDFPage
> from pdfminer.pdfpage import PDFTextExtractionNotAllowed
> from pdfminer.pdfinterp import PDFResourceManager
> from pdfminer.pdfinterp import PDFPageInterpreter
> from pdfminer.pdfdevice import PDFDevice
>
> # Open a PDF file.
> fp = open('C:\\USERS\\Python27\\samples\\test.pdf', 'rb')
> # Create a PDF parser object associated with the file object.
> parser = PDFParser(fp)
> # Create a PDF document object that stores the document structure.
> document = PDFDocument(parser)
>
> print "done"
> </code>
>
>
> I get the following error:
> PS C:\USERS\Python27> .\python.exe .\MyTest.py
> Traceback (most recent call last):
> File ".\MyTest.py", line 4, in <module>
> from pdfminer.pdfpage import PDFTextExtractionNotAllowed
> ImportError: cannot import name PDFTextExtractionNotAllowed
>
>
> If I run commenting out the import of "PDFTextExtractionNotAllowed" it runs without a problem. Quite odd.
>
A quick Google tokk me here:
http://css.dzone.com/articles/pdf-reading
Its example contains:
from pdfminer.pdfinterp import PDFResourceManager,
PDFPageInterpreter, PDFTextExtractionNotAllowed
Note how it's importing PDFTextExtractionNotAllowed from a different
place.
Perhaps the author of the code you're looking at didn't test it. It
happens! :-)
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
PDFMiner install question Jason Mellone <jason.mellone@gmail.com> - 2013-12-17 12:06 -0800
Re: PDFMiner install question Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-17 20:27 +0000
Re: PDFMiner install question MRAB <python@mrabarnett.plus.com> - 2013-12-17 20:32 +0000
Re: PDFMiner install question Jason Mellone <jason.mellone@gmail.com> - 2013-12-17 12:53 -0800
Re: PDFMiner install question Jason Mellone <jason.mellone@gmail.com> - 2013-12-17 12:59 -0800
Re: PDFMiner install question Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-17 22:03 +0000
Re: PDFMiner install question MRAB <python@mrabarnett.plus.com> - 2013-12-17 23:30 +0000
Re: PDFMiner install question Jason Mellone <jason.mellone@gmail.com> - 2013-12-19 11:36 -0800
Re: PDFMiner install question MRAB <python@mrabarnett.plus.com> - 2013-12-19 21:18 +0000
Re: PDFMiner install question Andreas Perstinger <andipersti@gmail.com> - 2013-12-20 10:00 +0100
csiph-web