1 | <?php |
||
17 | class PdfRequest extends CaptureRequest |
||
18 | implements PdfRequestInterface |
||
19 | { |
||
20 | /** |
||
21 | * Paper width |
||
22 | * |
||
23 | * @var int |
||
24 | * @access protected |
||
25 | */ |
||
26 | protected $paperWidth; |
||
27 | |||
28 | /** |
||
29 | * Paper height |
||
30 | * |
||
31 | * @var int |
||
32 | * @access protected |
||
33 | */ |
||
34 | protected $paperHeight; |
||
35 | |||
36 | /** |
||
37 | * Format |
||
38 | * |
||
39 | * @var string |
||
40 | * @access protected |
||
41 | */ |
||
42 | protected $format; |
||
43 | |||
44 | /** |
||
45 | * Orientation |
||
46 | * |
||
47 | * @var string |
||
48 | * @access protected |
||
49 | */ |
||
50 | protected $orientation; |
||
51 | |||
52 | /** |
||
53 | * Margin |
||
54 | * |
||
55 | * @var string|array |
||
56 | * @access protected |
||
57 | */ |
||
58 | protected $margin; |
||
59 | |||
60 | /** |
||
61 | * Repeating header |
||
62 | * |
||
63 | * @var array |
||
64 | * @access protected |
||
65 | */ |
||
66 | protected $header; |
||
67 | |||
68 | /** |
||
69 | * Repeating footer |
||
70 | * |
||
71 | * @var array |
||
72 | * @access protected |
||
73 | */ |
||
74 | protected $footer; |
||
75 | |||
76 | /** |
||
77 | * Zoom property specifies the scaling factor for the page.render and page.renderBase64 functions |
||
78 | * The default is 1, i.e. 100% zoom |
||
79 | * |
||
80 | * @var float |
||
81 | * @access protected |
||
82 | */ |
||
83 | protected $zoom; |
||
84 | |||
85 | 29 | /** |
|
86 | * Internal constructor |
||
87 | 29 | * |
|
88 | * @access public |
||
89 | 29 | * @param string $url (default: null) |
|
90 | 29 | * @param string $method (default: RequestInterface::METHOD_GET) |
|
91 | 29 | * @param int $timeout (default: 5000) |
|
92 | 29 | * @return \JonnyW\PhantomJs\Http\CaptureRequest |
|
|
|||
93 | 29 | */ |
|
94 | 29 | public function __construct($url = null, $method = RequestInterface::METHOD_GET, $timeout = 5000) |
|
107 | 8 | ||
108 | 7 | /** |
|
109 | * Get request type |
||
110 | * |
||
111 | 1 | * @access public |
|
112 | * @return string |
||
113 | */ |
||
114 | public function getType() |
||
122 | |||
123 | /** |
||
124 | * Set paper width. |
||
125 | * |
||
126 | * @access public |
||
127 | * @param string $width |
||
128 | * @return void |
||
129 | */ |
||
130 | public function setPaperWidth($width) |
||
134 | 7 | ||
135 | /** |
||
136 | * Get paper width. |
||
137 | * |
||
138 | * @access public |
||
139 | * @return string |
||
140 | */ |
||
141 | public function getPaperWidth() |
||
145 | |||
146 | /** |
||
147 | * Set paper height. |
||
148 | * |
||
149 | * @access public |
||
150 | * @param string $height |
||
151 | * @return void |
||
152 | */ |
||
153 | public function setPaperHeight($height) |
||
157 | 7 | ||
158 | /** |
||
159 | * Get paper height. |
||
160 | * |
||
161 | * @access public |
||
162 | * @return string |
||
163 | */ |
||
164 | public function getPaperHeight() |
||
168 | 3 | ||
169 | /** |
||
170 | 3 | * Set paper size. |
|
171 | 3 | * |
|
172 | 3 | * @access public |
|
173 | * @param string $width |
||
174 | * @param string $height |
||
175 | * @return void |
||
176 | */ |
||
177 | public function setPaperSize($width, $height) |
||
182 | |||
183 | 4 | /** |
|
184 | 4 | * Set format. |
|
185 | * |
||
186 | * @access public |
||
187 | * @param string $format |
||
188 | * @return void |
||
189 | */ |
||
190 | public function setFormat($format) |
||
194 | 6 | ||
195 | /** |
||
196 | * Get format. |
||
197 | * |
||
198 | * @access public |
||
199 | * @return string |
||
200 | */ |
||
201 | public function getFormat() |
||
205 | |||
206 | 3 | /** |
|
207 | 3 | * Set orientation. |
|
208 | * |
||
209 | * @access public |
||
210 | * @param string $orientation |
||
211 | * @return void |
||
212 | */ |
||
213 | public function setOrientation($orientation) |
||
217 | 6 | ||
218 | /** |
||
219 | * Get orientation. |
||
220 | * |
||
221 | * @access public |
||
222 | * @return string |
||
223 | */ |
||
224 | public function getOrientation() |
||
228 | |||
229 | 5 | /** |
|
230 | 5 | * Set margin. |
|
231 | * |
||
232 | * @access public |
||
233 | * @param string|array $margin |
||
234 | * @return void |
||
235 | */ |
||
236 | public function setMargin($margin) |
||
240 | 6 | ||
241 | /** |
||
242 | * Get margin. |
||
243 | * |
||
244 | * @access public |
||
245 | * @return string|array |
||
246 | */ |
||
247 | public function getMargin() |
||
251 | 2 | ||
252 | /** |
||
253 | 2 | * Set repeating header. |
|
254 | 2 | * |
|
255 | * @access public |
||
256 | 2 | * @param string $content |
|
257 | 2 | * @param string $height (default: '1cm') |
|
258 | * @return void |
||
259 | */ |
||
260 | public function setRepeatingHeader($content, $height = '1cm') |
||
267 | 6 | ||
268 | /** |
||
269 | * Get repeating header. |
||
270 | * |
||
271 | * @access public |
||
272 | * @return array |
||
273 | */ |
||
274 | public function getRepeatingHeader() |
||
278 | 2 | ||
279 | /** |
||
280 | 2 | * Set repeating footer. |
|
281 | 2 | * |
|
282 | * @access public |
||
283 | 2 | * @param string $content |
|
284 | 2 | * @param string $height (default: '1cm') |
|
285 | * @return void |
||
286 | */ |
||
287 | public function setRepeatingFooter($content, $height = '1cm') |
||
294 | 6 | ||
295 | /** |
||
296 | * Get repeating footer. |
||
297 | * |
||
298 | * @access public |
||
299 | * @return array |
||
300 | */ |
||
301 | public function getRepeatingFooter() |
||
305 | |||
306 | /** |
||
307 | * Set zoom |
||
308 | * |
||
309 | * @access public |
||
310 | * @param float $zoom (default: 1) |
||
311 | * @return void |
||
312 | */ |
||
313 | public function setZoom($zoom) |
||
317 | |||
318 | /** |
||
319 | * Get zoom |
||
320 | * |
||
321 | * @access public |
||
322 | * @return float |
||
323 | */ |
||
324 | public function getZoom() |
||
328 | } |
||
329 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.