Create a new PdfPages object. Parameters ---------- filename : str or path-like Plots using `PdfPages.savefig` will be written to a file at this location. Any older file with the same name is overwritten. metadata : dict, optional
(self, filename, *, metadata=None)
| 909 | """ |
| 910 | |
| 911 | def __init__(self, filename, *, metadata=None): |
| 912 | """ |
| 913 | Create a new PdfPages object. |
| 914 | |
| 915 | Parameters |
| 916 | ---------- |
| 917 | filename : str or path-like |
| 918 | Plots using `PdfPages.savefig` will be written to a file at this |
| 919 | location. Any older file with the same name is overwritten. |
| 920 | |
| 921 | metadata : dict, optional |
| 922 | Information dictionary object (see PDF reference section 10.2.1 |
| 923 | 'Document Information Dictionary'), e.g.: |
| 924 | ``{'Creator': 'My software', 'Author': 'Me', 'Title': 'Awesome'}``. |
| 925 | |
| 926 | The standard keys are 'Title', 'Author', 'Subject', 'Keywords', |
| 927 | 'Creator', 'Producer', 'CreationDate', 'ModDate', and |
| 928 | 'Trapped'. Values have been predefined for 'Creator', 'Producer' |
| 929 | and 'CreationDate'. They can be removed by setting them to `None`. |
| 930 | |
| 931 | Note that some versions of LaTeX engines may ignore the 'Producer' |
| 932 | key and set it to themselves. |
| 933 | """ |
| 934 | self._output_name = filename |
| 935 | self._n_figures = 0 |
| 936 | self._metadata = (metadata or {}).copy() |
| 937 | self._info_dict = _create_pdf_info_dict('pgf', self._metadata) |
| 938 | self._file = BytesIO() |
| 939 | |
| 940 | def _write_header(self, width_inches, height_inches): |
| 941 | pdfinfo = ','.join( |
no test coverage detected