win32 bug fixed

git-svn-id: https://pdfminerr.googlecode.com/svn/trunk/pdfminer@27 1aa58f4a-7d42-0410-adbc-911cccaed67c
pull/1/head
yusuke.shinyama.dummy 2008-04-29 11:17:06 +00:00
parent d30248029b
commit 43436a4abb
5 changed files with 9 additions and 8 deletions

View File

@ -1,7 +1,7 @@
# Makefile for pdfminer
PACKAGE=pdfminer
VERSION=20080427
VERSION=20080429
GNUTAR=tar
SVN=svn
PYTHON=python

View File

@ -11,7 +11,7 @@ blockquote { background: #eeeeee; }
<h1>PDFMiner</h1>
<div align=right class=lastmod>
<!-- hhmts start -->
Last Modified: Sun Apr 27 20:54:51 JST 2008
Last Modified: Tue Apr 29 20:16:22 JST 2008
<!-- hhmts end -->
</div>
@ -44,8 +44,8 @@ http://www.unixuser.org/~euske/python/pdfminer/index.html
<p>
<strong>Download (source):</strong><br>
<a href="http://www.unixuser.org/~euske/python/pdfminer/pdfminer-dist-20080427.tar.gz">
http://www.unixuser.org/~euske/python/pdfminer/pdfminer-dist-20080427.tar.gz
<a href="http://www.unixuser.org/~euske/python/pdfminer/pdfminer-dist-20080429.tar.gz">
http://www.unixuser.org/~euske/python/pdfminer/pdfminer-dist-20080429.tar.gz
</a>
(1.8Mbytes)
@ -216,6 +216,7 @@ no stream header is displayed for the ease of saving it to a file.
<hr noshade>
<h2>Changes</h2>
<ul>
<li> 2007/04/29: Bugfix for Win32. Thanks to Chris Clark.
<li> 2007/04/27: Basic encryption and LZW decoding support added.
<li> 2007/01/07: Several bugfixes. Thanks to Nick Fabry for his contribution.
<li> 2007/12/31: Initial release.

View File

@ -199,7 +199,7 @@ class CMapDB:
if 1 <= klass.debug:
print >>stderr, 'Reading: CMap %r...' % fname
cmap = CMap()
fp = file(fname)
fp = file(fname, 'rb')
CMapParser(cmap, fp, debug=klass.debug).run()
fp.close()
elif not strict:

View File

@ -99,7 +99,7 @@ def dumpallobjs(out, doc):
def dumppdf(outfp, fname, objids, pageids, password='',
dumpall=False, codec=None, debug=0):
doc = PDFDocument(debug=debug)
fp = file(fname)
fp = file(fname, 'rb')
parser = PDFParser(doc, fp, debug=debug)
doc.initialize(password)
if objids:
@ -151,7 +151,7 @@ def main(argv):
elif k == '-r': codec = 'raw'
elif k == '-b': codec = 'binary'
elif k == '-t': codec = 'text'
elif k == '-o': outfp = file(v, 'w')
elif k == '-o': outfp = file(v, 'wb')
#
for fname in args:
dumppdf(outfp, fname, objids, pageids, password=password,

View File

@ -171,7 +171,7 @@ class TextExtractionNotAllowed(RuntimeError): pass
def pdf2txt(outfp, rsrc, fname, pages, codec, password='', debug=0):
device = TextConverter(rsrc, debug=debug)
doc = PDFDocument(debug=debug)
fp = file(fname)
fp = file(fname, 'rb')
parser = PDFParser(doc, fp, debug=debug)
try:
doc.initialize(password)