'Removes images from this output.
:param bool ignoreByteStringObject: optional parameter
to ignore ByteString Objects.'

def removeImages(self, ignoreByteStringObject=False):

    pages = self.getObject(self._pages)['/Kids']
    for j in range(len(pages)):
        page = pages[j]
        pageRef = self.getObject(page)
        content = pageRef['/Contents'].getObject()
        if (not isinstance(content, ContentStream)):
            content = ContentStream(content, pageRef)
        _operations = []
        seq_graphics = False
        for (operands, operator) in content.operations:
            if (operator == b_('Tj')):
                text = operands[0]
                if ignoreByteStringObject:
                    if (not isinstance(text, TextStringObject)):
                        operands[0] = TextStringObject()
            elif (operator == b_("'")):
                text = operands[0]
                if ignoreByteStringObject:
                    if (not isinstance(text, TextStringObject)):
                        operands[0] = TextStringObject()
            elif (operator == b_('"')):
                text = operands[2]
                if ignoreByteStringObject:
                    if (not isinstance(text, TextStringObject)):
                        operands[2] = TextStringObject()
            elif (operator == b_('TJ')):
                for i in range(len(operands[0])):
                    if ignoreByteStringObject:
                        if (not isinstance(operands[0][i], TextStringObject)):
                            operands[0][i] = TextStringObject()
            if (operator == b_('q')):
                seq_graphics = True
            if (operator == b_('Q')):
                seq_graphics = False
            if seq_graphics:
                if (operator in [b_('cm'), b_('w'), b_('J'), b_('j'), b_('M'), b_('d'), b_('ri'), b_('i'), b_('gs'), b_('W'), b_('b'), b_('s'), b_('S'), b_('f'), b_('F'), b_('n'), b_('m'), b_('l'), b_('c'), b_('v'), b_('y'), b_('h'), b_('B'), b_('Do'), b_('sh')]):
                    continue
            if (operator == b_('re')):
                continue
            _operations.append((operands, operator))
        content.operations = _operations
        pageRef.__setitem__(NameObject('/Contents'), content)
