(self, width, height)
| 753 | return d |
| 754 | |
| 755 | def newPage(self, width, height): |
| 756 | self.endStream() |
| 757 | |
| 758 | self.width, self.height = width, height |
| 759 | contentObject = self.reserveObject('page contents') |
| 760 | annotsObject = self.reserveObject('annotations') |
| 761 | thePage = {'Type': Name('Page'), |
| 762 | 'Parent': self.pagesObject, |
| 763 | 'Resources': self.resourceObject, |
| 764 | 'MediaBox': [0, 0, 72 * width, 72 * height], |
| 765 | 'Contents': contentObject, |
| 766 | 'Annots': annotsObject, |
| 767 | } |
| 768 | pageObject = self.reserveObject('page') |
| 769 | self.writeObject(pageObject, thePage) |
| 770 | self.pageList.append(pageObject) |
| 771 | self._annotations.append((annotsObject, self.pageAnnotations)) |
| 772 | |
| 773 | self.beginStream(contentObject.id, |
| 774 | self.reserveObject('length of content stream')) |
| 775 | # Initialize the pdf graphics state to match the default Matplotlib |
| 776 | # graphics context (colorspace and joinstyle). |
| 777 | self.output(Name('DeviceRGB'), Op.setcolorspace_stroke) |
| 778 | self.output(Name('DeviceRGB'), Op.setcolorspace_nonstroke) |
| 779 | self.output(GraphicsContextPdf.joinstyles['round'], Op.setlinejoin) |
| 780 | |
| 781 | # Clear the list of annotations for the next page |
| 782 | self.pageAnnotations = [] |
| 783 | |
| 784 | def newTextnote(self, text, positionRect=[-100, -100, 0, 0]): |
| 785 | # Create a new annotation of type text |
no test coverage detected