diff --git a/docs/index.html b/docs/index.html
index bf81c2e..debb308 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -19,7 +19,7 @@ Python PDF parser and analyzer
-Last Modified: Sat Feb 27 03:58:45 UTC 2010
+Last Modified: Fri Mar 12 13:45:59 UTC 2010
@@ -348,6 +348,7 @@ no stream header is displayed for the ease of saving it to a file.
Changes
+- 2010/03/12: A couple of bugfixes. Thanks to Sean Manefield.
- 2010/02/27: Changed the way of internal layout handling. (LTTextItem -> LTChar)
- 2010/02/15: Several bugfixes. Thanks to Sean.
- 2010/02/13: Bugfix and enhancement. Thanks to André Auzi.
diff --git a/pdfminer/pdfinterp.py b/pdfminer/pdfinterp.py
index 5158761..0695741 100644
--- a/pdfminer/pdfinterp.py
+++ b/pdfminer/pdfinterp.py
@@ -69,6 +69,20 @@ class PDFTextState(object):
self.scaling, self.leading, self.render, self.rise,
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):
self.matrix = MATRIX_IDENTITY
self.linematrix = (0, 0)
@@ -89,6 +103,17 @@ class PDFGraphicState(object):
self.flatness = None
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):
return ('' %
@@ -126,7 +151,7 @@ class PDFResourceManager(object):
return CMapDB.get_cmap(cmapname)
except CMapDB.CMapNotFound:
if strict: raise
- return CMapDB.CMap()
+ return CMap()
def get_font(self, objid, spec):
if objid and objid in self.fonts:
@@ -347,7 +372,7 @@ class PDFPageInterpreter(object):
return x
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):
(self.ctm, self.textstate, self.graphicstate) = state