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 | * Imports a raster image into the document. |
||
86 | * |
||
87 | * @param strings $filename |
||
88 | * @param bool $useLossyCompression |
||
89 | * @param int $compressionQuality |
||
90 | * @return Image |
||
91 | */ |
||
92 | public function importRasterImage($filename, $useLossyCompression = false, $compressionQuality = 80) |
||
102 | |||
103 | /** |
||
104 | * Ends the document by writing all pending data. |
||
105 | * |
||
106 | * While the PDF writer will remove all references to the passed in file object in itself to avoid further writing |
||
107 | * and to allow the file pointer to be closed, the callee may still have a reference to it. If that is the case, |
||
108 | * make sure to unset it if you don't need it. |
||
109 | * |
||
110 | * Any further attempts to append data to the PDF writer will result in an exception. |
||
111 | */ |
||
112 | public function endDocument() |
||
116 | |||
117 | /** |
||
118 | * Creates a PDF writer which writes everything to a file. |
||
119 | * |
||
120 | * @param string $filename |
||
121 | * @param PdfWriterOptions|null $options |
||
122 | * @return static |
||
123 | */ |
||
124 | public static function toFile($filename, PdfWriterOptions $options = null) |
||
128 | |||
129 | /** |
||
130 | * Creates a PDF writer which outputs everything to the STDOUT. |
||
131 | * |
||
132 | * Make sure to send the appropriate headers beforehand if you are in a web environment. |
||
133 | * |
||
134 | * @param PdfWriterOptions|null $options |
||
135 | * @return static |
||
136 | */ |
||
137 | public static function output(PdfWriterOptions $options = null) |
||
141 | } |
||
142 |