# Path: pdfminer/utils.py
# def mult_matrix(m1, m0):
#     (a1, b1, c1, d1, e1, f1) = m1
#     (a0, b0, c0, d0, e0, f0) = m0
#     """Returns the multiplication of two matrices."""
#     return (a0*a1+c0*b1,    b0*a1+d0*b1,
#             a0*c1+c0*d1,    b0*c1+d0*d1,
#             a0*e1+c0*f1+e0, b0*e1+d0*f1+f0)
# 
# Path: pdfminer/utils.py
# def translate_matrix(m, v):
#     """Translates a matrix by (x, y)."""
#     (a, b, c, d, e, f) = m
#     (x, y) = v
#     return (a, b, c, d, x*a+y*c+e, x*b+y*d+f)
# 
# Path: pdfminer/utils.py
# def q(s):
#     """Quotes html string."""
#     return (s.replace('&','&amp;')
#             .replace('<','&lt;')
#             .replace('>','&gt;')
#             .replace('"','&quot;'))
# 
# Path: pdfminer/utils.py
# def bbox2str(bbox):
#     (x0, y0, x1, y1) = bbox
#     return '%.3f,%.3f,%.3f,%.3f' % (x0, y0, x1, y1)
# 
# Path: pdfminer/utils.py
# def isnumber(x):
#     return isinstance(x, (int, float))
# 
# Path: pdfminer/pdffont.py
# class PDFUnicodeNotDefined(PDFFontError):
#     pass


from .utils import mult_matrix
from .utils import translate_matrix
from .utils import q
from .utils import bbox2str
from .utils import isnumber
from .pdffont import PDFUnicodeNotDefined
        return (x, y)

    def render_char(self, matrix, font, fontsize, scaling, rise, cid):
        return 0


##  TagExtractor
##
class TagExtractor(PDFDevice):

    def __init__(self, rsrcmgr, outfp):
        PDFDevice.__init__(self, rsrcmgr)
        self.outfp = outfp
        self.pageno = 0
        self._stack = []
        return

    def render_string(self, textstate, seq):
        font = textstate.font
        text = ''
        for obj in seq:
            if not isinstance(obj, bytes):
                continue
            chars = font.decode(obj)
            for cid in chars:
                try:
                    char = font.to_unichr(cid)
                    text += char
                except PDFUnicodeNotDefined:
                    pass

# Path: pdfminer/utils.py
# def mult_matrix(m1, m0):
#     (a1, b1, c1, d1, e1, f1) = m1
#     (a0, b0, c0, d0, e0, f0) = m0
#     """Returns the multiplication of two matrices."""
#     return (a0*a1+c0*b1,    b0*a1+d0*b1,
#             a0*c1+c0*d1,    b0*c1+d0*d1,
#             a0*e1+c0*f1+e0, b0*e1+d0*f1+f0)
# 
# Path: pdfminer/utils.py
# def translate_matrix(m, v):
#     """Translates a matrix by (x, y)."""
#     (a, b, c, d, e, f) = m
#     (x, y) = v
#     return (a, b, c, d, x*a+y*c+e, x*b+y*d+f)
# 
# Path: pdfminer/utils.py
# def q(s):
#     """Quotes html string."""
#     return (s.replace('&','&amp;')
#             .replace('<','&lt;')
#             .replace('>','&gt;')
#             .replace('"','&quot;'))
# 
# Path: pdfminer/utils.py
# def bbox2str(bbox):
#     (x0, y0, x1, y1) = bbox
#     return '%.3f,%.3f,%.3f,%.3f' % (x0, y0, x1, y1)
# 
# Path: pdfminer/utils.py
# def isnumber(x):
#     return isinstance(x, (int, float))
# 
# Path: pdfminer/pdffont.py
# class PDFUnicodeNotDefined(PDFFontError):
#     pass


# Path: pdfminer/pdfdevice.py
from .utils import mult_matrix
from .utils import translate_matrix
from .utils import q
from .utils import bbox2str
from .utils import isnumber
from .pdffont import PDFUnicodeNotDefined

        return (x, y)

    def render_char(self, matrix, font, fontsize, scaling, rise, cid):
        return 0


##  TagExtractor
##
class TagExtractor(PDFDevice):

    def __init__(self, rsrcmgr, outfp):
        PDFDevice.__init__(self, rsrcmgr)
        self.outfp = outfp
        self.pageno = 0
        self._stack = []
        return

    def render_string(self, textstate, seq):
        font = textstate.font
        text = ''
        for obj in seq:
            if not isinstance(obj, bytes):
                continue
            chars = font.decode(obj)
            for cid in chars:
                try:
                    char = font.to_unichr(cid)
                    text += char
                except PDFUnicodeNotDefined:
                    pass

        self.outfp.write(q(text))