(self, xobjid)
| 711 | |
| 712 | # invoke an XObject |
| 713 | def do_Do(self, xobjid): |
| 714 | xobjid = literal_name(xobjid) |
| 715 | try: |
| 716 | xobj = stream_value(self.xobjmap[xobjid]) |
| 717 | except KeyError: |
| 718 | if STRICT: |
| 719 | raise PDFInterpreterError('Undefined xobject id: %r' % xobjid) |
| 720 | return |
| 721 | if 1 <= self.debug: |
| 722 | print >>sys.stderr, 'Processing xobj: %r' % xobj |
| 723 | subtype = xobj.get('Subtype') |
| 724 | if subtype is LITERAL_FORM and 'BBox' in xobj: |
| 725 | interpreter = self.dup() |
| 726 | bbox = list_value(xobj['BBox']) |
| 727 | matrix = list_value(xobj.get('Matrix', MATRIX_IDENTITY)) |
| 728 | # According to PDF reference 1.7 section 4.9.1, XObjects in |
| 729 | # earlier PDFs (prior to v1.2) use the page's Resources entry |
| 730 | # instead of having their own Resources entry. |
| 731 | resources = dict_value(xobj.get('Resources')) or self.resources.copy() |
| 732 | self.device.begin_figure(xobjid, bbox, matrix) |
| 733 | interpreter.render_contents(resources, [xobj], ctm=mult_matrix(matrix, self.ctm)) |
| 734 | self.device.end_figure(xobjid) |
| 735 | elif subtype is LITERAL_IMAGE and 'Width' in xobj and 'Height' in xobj: |
| 736 | self.device.begin_figure(xobjid, (0,0,1,1), MATRIX_IDENTITY) |
| 737 | self.device.render_image(xobjid, xobj) |
| 738 | self.device.end_figure(xobjid) |
| 739 | else: |
| 740 | # unsupported xobject type. |
| 741 | pass |
| 742 | return |
| 743 | |
| 744 | def process_page(self, page): |
| 745 | if 1 <= self.debug: |
nothing calls this directly
no test coverage detected