(self, streams)
| 771 | return |
| 772 | |
| 773 | def execute(self, streams): |
| 774 | try: |
| 775 | parser = PDFContentParser(streams) |
| 776 | except PSEOF: |
| 777 | # empty page |
| 778 | return |
| 779 | while 1: |
| 780 | try: |
| 781 | (_,obj) = parser.nextobject() |
| 782 | except PSEOF: |
| 783 | break |
| 784 | if isinstance(obj, PSKeyword): |
| 785 | name = keyword_name(obj) |
| 786 | method = 'do_%s' % name.replace('*','_a').replace('"','_w').replace("'",'_q') |
| 787 | if hasattr(self, method): |
| 788 | func = getattr(self, method) |
| 789 | nargs = func.func_code.co_argcount-1 |
| 790 | if nargs: |
| 791 | args = self.pop(nargs) |
| 792 | if 2 <= self.debug: |
| 793 | print >>sys.stderr, 'exec: %s %r' % (name, args) |
| 794 | if len(args) == nargs: |
| 795 | func(*args) |
| 796 | else: |
| 797 | if 2 <= self.debug: |
| 798 | print >>sys.stderr, 'exec: %s' % (name) |
| 799 | func() |
| 800 | else: |
| 801 | if STRICT: |
| 802 | raise PDFInterpreterError('Unknown operator: %r' % name) |
| 803 | else: |
| 804 | self.push(obj) |
| 805 | return |
| 806 | |
| 807 | |
| 808 | ## process_pdf |
no test coverage detected