@@ -348,11 +348,22 @@ class Stream:
348
348
__slots__ = ('id' , 'len' , 'pdfFile' , 'file' , 'compressobj' , 'extra' , 'pos' )
349
349
350
350
def __init__ (self , id , len , file , extra = None , png = None ):
351
- """id: object id of stream; len: an unused Reference object for the
352
- length of the stream, or None (to use a memory buffer); file:
353
- a PdfFile; extra: a dictionary of extra key-value pairs to
354
- include in the stream header; png: if the data is already
355
- png compressed, the decode parameters"""
351
+ """
352
+ Parameters
353
+ ----------
354
+
355
+ id : int
356
+ object id of the stream
357
+ len : Reference or None
358
+ an unused Reference object for the length of the stream;
359
+ None means to use a memory buffer so the length can be inlined
360
+ file : PdfFile
361
+ the underlying object to write the stream to
362
+ extra : dict from Name to anything, or None
363
+ extra key-value pairs to include in the stream header
364
+ png : dict or None
365
+ if the data is already png encoded, the decode parameters
366
+ """
356
367
self .id = id # object id
357
368
self .len = len # id of length object
358
369
self .pdfFile = file
@@ -424,6 +435,24 @@ class PdfFile:
424
435
"""PDF file object."""
425
436
426
437
def __init__ (self , filename , metadata = None ):
438
+ """
439
+ Parameters
440
+ ----------
441
+
442
+ filename : file-like object or string
443
+ output target; if a string, a file will be opened for writing
444
+ metadata : dict from strings to strings and dates
445
+ Information dictionary object (see PDF reference section 10.2.1
446
+ 'Document Information Dictionary'), e.g.:
447
+ `{'Creator': 'My software', 'Author': 'Me',
448
+ 'Title': 'Awesome fig'}`
449
+
450
+ The standard keys are `'Title'`, `'Author'`, `'Subject'`,
451
+ `'Keywords'`, `'Creator'`, `'Producer'`, `'CreationDate'`,
452
+ `'ModDate'`, and `'Trapped'`. Values have been predefined
453
+ for `'Creator'`, `'Producer'` and `'CreationDate'`. They
454
+ can be removed by setting them to `None`.
455
+ """
427
456
self .objectId = itertools .count (1 ) # consumed by reserveObject
428
457
self .xrefTable = [[0 , 65535 , 'the zero object' ]]
429
458
self .passed_in_file_object = False
@@ -2310,13 +2339,6 @@ def finalize(self):
2310
2339
cmds .extend (self .pop ())
2311
2340
return cmds
2312
2341
2313
- ########################################################################
2314
- #
2315
- # The following functions and classes are for pylab and implement
2316
- # window/figure managers, etc...
2317
- #
2318
- ########################################################################
2319
-
2320
2342
2321
2343
class PdfPages :
2322
2344
"""
0 commit comments