A couple of bugfixes. Thanks to Sean Manefield.
git-svn-id: https://pdfminerr.googlecode.com/svn/trunk/pdfminer@185 1aa58f4a-7d42-0410-adbc-911cccaed67cpull/1/head
parent
23be96c49e
commit
85c5476623
|
@ -19,7 +19,7 @@ Python PDF parser and analyzer
|
||||||
|
|
||||||
<div align=right class=lastmod>
|
<div align=right class=lastmod>
|
||||||
<!-- hhmts start -->
|
<!-- hhmts start -->
|
||||||
Last Modified: Sat Feb 27 03:58:45 UTC 2010
|
Last Modified: Fri Mar 12 13:45:59 UTC 2010
|
||||||
<!-- hhmts end -->
|
<!-- hhmts end -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -348,6 +348,7 @@ no stream header is displayed for the ease of saving it to a file.
|
||||||
<hr noshade>
|
<hr noshade>
|
||||||
<h2>Changes</h2>
|
<h2>Changes</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li> 2010/03/12: A couple of bugfixes. Thanks to Sean Manefield.
|
||||||
<li> 2010/02/27: Changed the way of internal layout handling. (LTTextItem -> LTChar)
|
<li> 2010/02/27: Changed the way of internal layout handling. (LTTextItem -> LTChar)
|
||||||
<li> 2010/02/15: Several bugfixes. Thanks to Sean.
|
<li> 2010/02/15: Several bugfixes. Thanks to Sean.
|
||||||
<li> 2010/02/13: Bugfix and enhancement. Thanks to André Auzi.
|
<li> 2010/02/13: Bugfix and enhancement. Thanks to André Auzi.
|
||||||
|
|
|
@ -69,6 +69,20 @@ class PDFTextState(object):
|
||||||
self.scaling, self.leading, self.render, self.rise,
|
self.scaling, self.leading, self.render, self.rise,
|
||||||
self.matrix, self.linematrix))
|
self.matrix, self.linematrix))
|
||||||
|
|
||||||
|
def copy(self):
|
||||||
|
obj = PDFTextState()
|
||||||
|
obj.font = self.font
|
||||||
|
obj.fontsize = self.fontsize
|
||||||
|
obj.charspace = self.charspace
|
||||||
|
obj.wordspace = self.wordspace
|
||||||
|
obj.scaling = self.scaling
|
||||||
|
obj.leading = self.leading
|
||||||
|
obj.render = self.render
|
||||||
|
obj.rise = self.rise
|
||||||
|
obj.matrix = self.matrix
|
||||||
|
obj.linematrix = self.linematrix
|
||||||
|
return obj
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
self.matrix = MATRIX_IDENTITY
|
self.matrix = MATRIX_IDENTITY
|
||||||
self.linematrix = (0, 0)
|
self.linematrix = (0, 0)
|
||||||
|
@ -89,6 +103,17 @@ class PDFGraphicState(object):
|
||||||
self.flatness = None
|
self.flatness = None
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def copy(self):
|
||||||
|
obj = PDFGraphicState()
|
||||||
|
obj.linewidth = self.linewidth
|
||||||
|
obj.linecap = self.linecap
|
||||||
|
obj.linejoin = self.linejoin
|
||||||
|
obj.miterlimit = self.miterlimit
|
||||||
|
obj.dash = self.dash
|
||||||
|
obj.intent = self.intent
|
||||||
|
obj.flatness = self.flatness
|
||||||
|
return obj
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return ('<PDFGraphicState: linewidth=%r, linecap=%r, linejoin=%r, '
|
return ('<PDFGraphicState: linewidth=%r, linecap=%r, linejoin=%r, '
|
||||||
' miterlimit=%r, dash=%r, intent=%r, flatness=%r>' %
|
' miterlimit=%r, dash=%r, intent=%r, flatness=%r>' %
|
||||||
|
@ -126,7 +151,7 @@ class PDFResourceManager(object):
|
||||||
return CMapDB.get_cmap(cmapname)
|
return CMapDB.get_cmap(cmapname)
|
||||||
except CMapDB.CMapNotFound:
|
except CMapDB.CMapNotFound:
|
||||||
if strict: raise
|
if strict: raise
|
||||||
return CMapDB.CMap()
|
return CMap()
|
||||||
|
|
||||||
def get_font(self, objid, spec):
|
def get_font(self, objid, spec):
|
||||||
if objid and objid in self.fonts:
|
if objid and objid in self.fonts:
|
||||||
|
@ -347,7 +372,7 @@ class PDFPageInterpreter(object):
|
||||||
return x
|
return x
|
||||||
|
|
||||||
def get_current_state(self):
|
def get_current_state(self):
|
||||||
return (self.ctm, self.textstate, self.graphicstate)
|
return (self.ctm, self.textstate.copy(), self.graphicstate.copy())
|
||||||
|
|
||||||
def set_current_state(self, state):
|
def set_current_state(self, state):
|
||||||
(self.ctm, self.textstate, self.graphicstate) = state
|
(self.ctm, self.textstate, self.graphicstate) = state
|
||||||
|
|
Loading…
Reference in New Issue