1 | <?php |
||
19 | class PdfWriter |
||
20 | { |
||
21 | /** |
||
22 | * @var PdfWriterOptions |
||
23 | */ |
||
24 | private $options; |
||
25 | |||
26 | /** |
||
27 | * @var ObjectWriter |
||
28 | */ |
||
29 | private $objectWriter; |
||
30 | |||
31 | /** |
||
32 | * @var DocumentWriter |
||
33 | */ |
||
34 | private $documentWriter; |
||
35 | |||
36 | /** |
||
37 | * @var EncryptionInterface |
||
38 | */ |
||
39 | private $encryption; |
||
40 | |||
41 | /** |
||
42 | * @param SplFileObject $fileObject |
||
43 | * @param PdfWriterOptions $options |
||
44 | */ |
||
45 | public function __construct(SplFileObject $fileObject, PdfWriterOptions $options = null) |
||
58 | |||
59 | /** |
||
60 | * Returns the document information object. |
||
61 | * |
||
62 | * @return DocumentInformation |
||
63 | */ |
||
64 | public function getDocumentInformation() |
||
68 | |||
69 | /** |
||
70 | * Adds a page to the document. |
||
71 | * |
||
72 | * @param float $width |
||
73 | * @param float $height |
||
74 | * @return Page |
||
75 | */ |
||
76 | public function addPage($width, $height) |
||
83 | |||
84 | /** |
||
85 | * Ends the document by writing all pending data. |
||
86 | * |
||
87 | * While the PDF writer will remove all references to the passed in file object in itself to avoid further writing |
||
88 | * and to allow the file pointer to be closed, the callee may still have a reference to it. If that is the case, |
||
89 | * make sure to unset it if you don't need it. |
||
90 | * |
||
91 | * Any further attempts to append data to the PDF writer will result in an exception. |
||
92 | */ |
||
93 | public function endDocument() |
||
97 | |||
98 | /** |
||
99 | * Creates a PDF writer which writes everything to a file. |
||
100 | * |
||
101 | * @param string $filename |
||
102 | * @param PdfWriterOptions|null $options |
||
103 | * @return static |
||
104 | */ |
||
105 | public static function toFile($filename, PdfWriterOptions $options = null) |
||
109 | |||
110 | /** |
||
111 | * Creates a PDF writer which outputs everything to the STDOUT. |
||
112 | * |
||
113 | * Make sure to send the appropriate headers beforehand if you are in a web environment. |
||
114 | * |
||
115 | * @param PdfWriterOptions|null $options |
||
116 | * @return static |
||
117 | */ |
||
118 | public static function output(PdfWriterOptions $options = null) |
||
122 | } |
||
123 |