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

def removeText(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)
        for (operands, operator) in content.operations:
            if (operator == b_('Tj')):
                text = operands[0]
                if (not ignoreByteStringObject):
                    if isinstance(text, TextStringObject):
                        operands[0] = TextStringObject()
                elif (isinstance(text, TextStringObject) or isinstance(text, ByteStringObject)):
                    operands[0] = TextStringObject()
            elif (operator == b_("'")):
                text = operands[0]
                if (not ignoreByteStringObject):
                    if isinstance(text, TextStringObject):
                        operands[0] = TextStringObject()
                elif (isinstance(text, TextStringObject) or isinstance(text, ByteStringObject)):
                    operands[0] = TextStringObject()
            elif (operator == b_('"')):
                text = operands[2]
                if (not ignoreByteStringObject):
                    if isinstance(text, TextStringObject):
                        operands[2] = TextStringObject()
                elif (isinstance(text, TextStringObject) or isinstance(text, ByteStringObject)):
                    operands[2] = TextStringObject()
            elif (operator == b_('TJ')):
                for i in range(len(operands[0])):
                    if (not ignoreByteStringObject):
                        if isinstance(operands[0][i], TextStringObject):
                            operands[0][i] = TextStringObject()
                    elif (isinstance(operands[0][i], TextStringObject) or isinstance(operands[0][i], ByteStringObject)):
                        operands[0][i] = TextStringObject()
        pageRef.__setitem__(NameObject('/Contents'), content)
