Commit | Line | Data |
---|---|---|
7f254ad8 AE |
1 | <?php |
2 | namespace Dompdf; | |
3 | ||
4 | class Options | |
5 | { | |
6 | /** | |
7 | * The root of your DOMPDF installation | |
8 | * | |
9 | * @var string | |
10 | */ | |
11 | private $rootDir; | |
12 | ||
13 | /** | |
14 | * The location of a temporary directory. | |
15 | * | |
16 | * The directory specified must be writeable by the webserver process. | |
17 | * The temporary directory is required to download remote images and when | |
18 | * using the PFDLib back end. | |
19 | * | |
20 | * @var string | |
21 | */ | |
22 | private $tempDir; | |
23 | ||
24 | /** | |
25 | * The location of the DOMPDF font directory | |
26 | * | |
27 | * The location of the directory where DOMPDF will store fonts and font metrics | |
28 | * Note: This directory must exist and be writable by the webserver process. | |
29 | * | |
30 | * @var string | |
31 | */ | |
32 | private $fontDir; | |
33 | ||
34 | /** | |
35 | * The location of the DOMPDF font cache directory | |
36 | * | |
37 | * This directory contains the cached font metrics for the fonts used by DOMPDF. | |
38 | * This directory can be the same as $fontDir | |
39 | * | |
40 | * Note: This directory must exist and be writable by the webserver process. | |
41 | * | |
42 | * @var string | |
43 | */ | |
44 | private $fontCache; | |
45 | ||
46 | /** | |
47 | * dompdf's "chroot" | |
48 | * | |
49 | * Prevents dompdf from accessing system files or other files on the webserver. | |
50 | * All local files opened by dompdf must be in a subdirectory of this directory. | |
51 | * DO NOT set it to '/' since this could allow an attacker to use dompdf to | |
52 | * read any files on the server. This should be an absolute path. | |
53 | * | |
54 | * ==== IMPORTANT ==== | |
55 | * This setting may increase the risk of system exploit. Do not change | |
56 | * this settings without understanding the consequences. Additional | |
57 | * documentation is available on the dompdf wiki at: | |
58 | * https://github.com/dompdf/dompdf/wiki | |
59 | * | |
60 | * @var string | |
61 | */ | |
62 | private $chroot; | |
63 | ||
64 | /** | |
65 | * @var string | |
66 | */ | |
67 | private $logOutputFile; | |
68 | ||
69 | /** | |
70 | * html target media view which should be rendered into pdf. | |
71 | * List of types and parsing rules for future extensions: | |
72 | * http://www.w3.org/TR/REC-html40/types.html | |
73 | * screen, tty, tv, projection, handheld, print, braille, aural, all | |
74 | * Note: aural is deprecated in CSS 2.1 because it is replaced by speech in CSS 3. | |
75 | * Note, even though the generated pdf file is intended for print output, | |
76 | * the desired content might be different (e.g. screen or projection view of html file). | |
77 | * Therefore allow specification of content here. | |
78 | * | |
79 | * @var string | |
80 | */ | |
81 | private $defaultMediaType = "screen"; | |
82 | ||
83 | /** | |
84 | * The default paper size. | |
85 | * | |
86 | * North America standard is "letter"; other countries generally "a4" | |
87 | * @see Dompdf\Adapter\CPDF::PAPER_SIZES for valid sizes | |
88 | * | |
89 | * @var string | |
90 | */ | |
91 | private $defaultPaperSize = "letter"; | |
92 | ||
93 | /** | |
94 | * The default font family | |
95 | * | |
96 | * Used if no suitable fonts can be found. This must exist in the font folder. | |
97 | * | |
98 | * @var string | |
99 | */ | |
100 | private $defaultFont = "serif"; | |
101 | ||
102 | /** | |
103 | * Image DPI setting | |
104 | * | |
105 | * This setting determines the default DPI setting for images and fonts. The | |
106 | * DPI may be overridden for inline images by explictly setting the | |
107 | * image's width & height style attributes (i.e. if the image's native | |
108 | * width is 600 pixels and you specify the image's width as 72 points, | |
109 | * the image will have a DPI of 600 in the rendered PDF. The DPI of | |
110 | * background images can not be overridden and is controlled entirely | |
111 | * via this parameter. | |
112 | * | |
113 | * For the purposes of DOMPDF, pixels per inch (PPI) = dots per inch (DPI). | |
114 | * If a size in html is given as px (or without unit as image size), | |
115 | * this tells the corresponding size in pt at 72 DPI. | |
116 | * This adjusts the relative sizes to be similar to the rendering of the | |
117 | * html page in a reference browser. | |
118 | * | |
119 | * In pdf, always 1 pt = 1/72 inch | |
120 | * | |
121 | * @var int | |
122 | */ | |
123 | private $dpi = 96; | |
124 | ||
125 | /** | |
126 | * A ratio applied to the fonts height to be more like browsers' line height | |
127 | * | |
128 | * @var float | |
129 | */ | |
130 | private $fontHeightRatio = 1.1; | |
131 | ||
132 | /** | |
133 | * Enable embedded PHP | |
134 | * | |
135 | * If this setting is set to true then DOMPDF will automatically evaluate | |
136 | * embedded PHP contained within <script type="text/php"> ... </script> tags. | |
137 | * | |
138 | * ==== IMPORTANT ==== | |
139 | * Enabling this for documents you do not trust (e.g. arbitrary remote html | |
140 | * pages) is a security risk. Embedded scripts are run with the same level of | |
141 | * system access available to dompdf. Set this option to false (recommended) | |
142 | * if you wish to process untrusted documents. | |
143 | * | |
144 | * This setting may increase the risk of system exploit. Do not change | |
145 | * this settings without understanding the consequences. Additional | |
146 | * documentation is available on the dompdf wiki at: | |
147 | * https://github.com/dompdf/dompdf/wiki | |
148 | * | |
149 | * @var bool | |
150 | */ | |
151 | private $isPhpEnabled = false; | |
152 | ||
153 | /** | |
154 | * Enable remote file access | |
155 | * | |
156 | * If this setting is set to true, DOMPDF will access remote sites for | |
157 | * images and CSS files as required. | |
158 | * | |
159 | * ==== IMPORTANT ==== | |
160 | * This can be a security risk, in particular in combination with isPhpEnabled and | |
161 | * allowing remote html code to be passed to $dompdf = new DOMPDF(); $dompdf->load_html(...); | |
162 | * This allows anonymous users to download legally doubtful internet content which on | |
163 | * tracing back appears to being downloaded by your server, or allows malicious php code | |
164 | * in remote html pages to be executed by your server with your account privileges. | |
165 | * | |
166 | * This setting may increase the risk of system exploit. Do not change | |
167 | * this settings without understanding the consequences. Additional | |
168 | * documentation is available on the dompdf wiki at: | |
169 | * https://github.com/dompdf/dompdf/wiki | |
170 | * | |
171 | * @var bool | |
172 | */ | |
173 | private $isRemoteEnabled = false; | |
174 | ||
175 | /** | |
176 | * Enable inline Javascript | |
177 | * | |
178 | * If this setting is set to true then DOMPDF will automatically insert | |
179 | * JavaScript code contained within <script type="text/javascript"> ... </script> tags. | |
180 | * | |
181 | * @var bool | |
182 | */ | |
183 | private $isJavascriptEnabled = true; | |
184 | ||
185 | /** | |
186 | * Use the more-than-experimental HTML5 Lib parser | |
187 | * | |
188 | * @var bool | |
189 | */ | |
190 | private $isHtml5ParserEnabled = false; | |
191 | ||
192 | /** | |
193 | * Whether to enable font subsetting or not. | |
194 | * | |
195 | * @var is_bool | |
196 | */ | |
197 | private $isFontSubsettingEnabled = false; | |
198 | ||
199 | /** | |
200 | * @var bool | |
201 | */ | |
202 | private $debugPng = false; | |
203 | ||
204 | /** | |
205 | * @var bool | |
206 | */ | |
207 | private $debugKeepTemp = false; | |
208 | ||
209 | /** | |
210 | * @var bool | |
211 | */ | |
212 | private $debugCss = false; | |
213 | ||
214 | /** | |
215 | * @var bool | |
216 | */ | |
217 | private $debugLayout = false; | |
218 | ||
219 | /** | |
220 | * @var bool | |
221 | */ | |
222 | private $debugLayoutLines = true; | |
223 | ||
224 | /** | |
225 | * @var bool | |
226 | */ | |
227 | private $debugLayoutBlocks = true; | |
228 | ||
229 | /** | |
230 | * @var bool | |
231 | */ | |
232 | private $debugLayoutInline = true; | |
233 | ||
234 | /** | |
235 | * @var bool | |
236 | */ | |
237 | private $debugLayoutPaddingBox = true; | |
238 | ||
239 | /** | |
240 | * The PDF rendering backend to use | |
241 | * | |
242 | * Valid settings are 'PDFLib', 'CPDF', 'GD', and 'auto'. 'auto' will | |
243 | * look for PDFLib and use it if found, or if not it will fall back on | |
244 | * CPDF. 'GD' renders PDFs to graphic files. {@link Dompdf\CanvasFactory} | |
245 | * ultimately determines which rendering class to instantiate | |
246 | * based on this setting. | |
247 | * | |
248 | * @var string | |
249 | */ | |
250 | private $pdfBackend = "CPDF"; | |
251 | ||
252 | /** | |
253 | * PDFlib license key | |
254 | * | |
255 | * If you are using a licensed, commercial version of PDFlib, specify | |
256 | * your license key here. If you are using PDFlib-Lite or are evaluating | |
257 | * the commercial version of PDFlib, comment out this setting. | |
258 | * | |
259 | * @link http://www.pdflib.com | |
260 | * | |
261 | * If pdflib present in web server and auto or selected explicitely above, | |
262 | * a real license code must exist! | |
263 | * | |
264 | * @var string | |
265 | */ | |
266 | private $pdflibLicense = ""; | |
267 | ||
268 | /** | |
269 | * @var string | |
270 | * @deprecated | |
271 | */ | |
272 | private $adminUsername = "user"; | |
273 | ||
274 | /** | |
275 | * @var string | |
276 | * @deprecated | |
277 | */ | |
278 | private $adminPassword = "password"; | |
279 | ||
280 | /** | |
281 | * @param array $attributes | |
282 | */ | |
283 | public function __construct(array $attributes = null) | |
284 | { | |
285 | $this->setChroot(realpath(__DIR__ . "/../")); | |
286 | $this->setRootDir($this->getChroot()); | |
287 | $this->setTempDir(sys_get_temp_dir()); | |
288 | $this->setFontDir($this->chroot . DIRECTORY_SEPARATOR . "lib" . DIRECTORY_SEPARATOR . "fonts"); | |
289 | $this->setFontCache($this->getFontDir()); | |
290 | $this->setLogOutputFile($this->getTempDir() . DIRECTORY_SEPARATOR . "log.htm"); | |
291 | ||
292 | if (null !== $attributes) { | |
293 | $this->set($attributes); | |
294 | } | |
295 | } | |
296 | ||
297 | /** | |
298 | * @param array|string $attributes | |
299 | * @param null|mixed $value | |
300 | * @return $this | |
301 | */ | |
302 | public function set($attributes, $value = null) | |
303 | { | |
304 | if (!is_array($attributes)) { | |
305 | $attributes = array($attributes => $value); | |
306 | } | |
307 | foreach ($attributes as $key => $value) { | |
308 | if ($key === 'tempDir' || $key === 'temp_dir') { | |
309 | $this->setTempDir($value); | |
310 | } elseif ($key === 'fontDir' || $key === 'font_dir') { | |
311 | $this->setFontDir($value); | |
312 | } elseif ($key === 'fontCache' || $key === 'font_cache') { | |
313 | $this->setFontCache($value); | |
314 | } elseif ($key === 'chroot') { | |
315 | $this->setChroot($value); | |
316 | } elseif ($key === 'logOutputFile' || $key === 'log_output_file') { | |
317 | $this->setLogOutputFile($value); | |
318 | } elseif ($key === 'defaultMediaType' || $key === 'default_media_type') { | |
319 | $this->setDefaultMediaType($value); | |
320 | } elseif ($key === 'defaultPaperSize' || $key === 'default_paper_size') { | |
321 | $this->setDefaultPaperSize($value); | |
322 | } elseif ($key === 'defaultFont' || $key === 'default_font') { | |
323 | $this->setDefaultFont($value); | |
324 | } elseif ($key === 'dpi') { | |
325 | $this->setDpi($value); | |
326 | } elseif ($key === 'fontHeightRatio' || $key === 'font_height_ratio') { | |
327 | $this->setFontHeightRatio($value); | |
328 | } elseif ($key === 'isPhpEnabled' || $key === 'is_php_enabled' || $key === 'enable_php') { | |
329 | $this->setIsPhpEnabled($value); | |
330 | } elseif ($key === 'isRemoteEnabled' || $key === 'is_remote_enabled' || $key === 'enable_remote') { | |
331 | $this->setIsRemoteEnabled($value); | |
332 | } elseif ($key === 'isJavascriptEnabled' || $key === 'is_javascript_enabled' || $key === 'enable_javascript') { | |
333 | $this->setIsJavascriptEnabled($value); | |
334 | } elseif ($key === 'isHtml5ParserEnabled' || $key === 'is_html5_parser_enabled' || $key === 'enable_html5_parser') { | |
335 | $this->setIsHtml5ParserEnabled($value); | |
336 | } elseif ($key === 'isFontSubsettingEnabled' || $key === 'is_font_subsetting_enabled' || $key === 'enable_font_subsetting') { | |
337 | $this->setIsFontSubsettingEnabled($value); | |
338 | } elseif ($key === 'debugPng' || $key === 'debug_png') { | |
339 | $this->setDebugPng($value); | |
340 | } elseif ($key === 'debugKeepTemp' || $key === 'debug_keep_temp') { | |
341 | $this->setDebugKeepTemp($value); | |
342 | } elseif ($key === 'debugCss' || $key === 'debug_css') { | |
343 | $this->setDebugCss($value); | |
344 | } elseif ($key === 'debugLayout' || $key === 'debug_layout') { | |
345 | $this->setDebugLayout($value); | |
346 | } elseif ($key === 'debugLayoutLines' || $key === 'debug_layout_lines') { | |
347 | $this->setDebugLayoutLines($value); | |
348 | } elseif ($key === 'debugLayoutBlocks' || $key === 'debug_layout_blocks') { | |
349 | $this->setDebugLayoutBlocks($value); | |
350 | } elseif ($key === 'debugLayoutInline' || $key === 'debug_layout_inline') { | |
351 | $this->setDebugLayoutInline($value); | |
352 | } elseif ($key === 'debugLayoutPaddingBox' || $key === 'debug_layout_padding_box') { | |
353 | $this->setDebugLayoutPaddingBox($value); | |
354 | } elseif ($key === 'pdfBackend' || $key === 'pdf_backend') { | |
355 | $this->setPdfBackend($value); | |
356 | } elseif ($key === 'pdflibLicense' || $key === 'pdflib_license') { | |
357 | $this->setPdflibLicense($value); | |
358 | } elseif ($key === 'adminUsername' || $key === 'admin_username') { | |
359 | $this->setAdminUsername($value); | |
360 | } elseif ($key === 'adminPassword' || $key === 'admin_password') { | |
361 | $this->setAdminPassword($value); | |
362 | } | |
363 | } | |
364 | return $this; | |
365 | } | |
366 | ||
367 | /** | |
368 | * @param string $key | |
369 | * @return mixed | |
370 | */ | |
371 | public function get($key) | |
372 | { | |
373 | if ($key === 'tempDir' || $key === 'temp_dir') { | |
374 | return $this->getTempDir(); | |
375 | } elseif ($key === 'fontDir' || $key === 'font_dir') { | |
376 | return $this->getFontDir(); | |
377 | } elseif ($key === 'fontCache' || $key === 'font_cache') { | |
378 | return $this->getFontCache(); | |
379 | } elseif ($key === 'chroot') { | |
380 | return $this->getChroot(); | |
381 | } elseif ($key === 'logOutputFile' || $key === 'log_output_file') { | |
382 | return $this->getLogOutputFile(); | |
383 | } elseif ($key === 'defaultMediaType' || $key === 'default_media_type') { | |
384 | return $this->getDefaultMediaType(); | |
385 | } elseif ($key === 'defaultPaperSize' || $key === 'default_paper_size') { | |
386 | return $this->getDefaultPaperSize(); | |
387 | } elseif ($key === 'defaultFont' || $key === 'default_font') { | |
388 | return $this->getDefaultFont(); | |
389 | } elseif ($key === 'dpi') { | |
390 | return $this->getDpi(); | |
391 | } elseif ($key === 'fontHeightRatio' || $key === 'font_height_ratio') { | |
392 | return $this->getFontHeightRatio(); | |
393 | } elseif ($key === 'isPhpEnabled' || $key === 'is_php_enabled' || $key === 'enable_php') { | |
394 | return $this->getIsPhpEnabled(); | |
395 | } elseif ($key === 'isRemoteEnabled' || $key === 'is_remote_enabled' || $key === 'enable_remote') { | |
396 | return $this->getIsRemoteEnabled(); | |
397 | } elseif ($key === 'isJavascriptEnabled' || $key === 'is_javascript_enabled' || $key === 'enable_javascript') { | |
398 | return $this->getIsJavascriptEnabled(); | |
399 | } elseif ($key === 'isHtml5ParserEnabled' || $key === 'is_html5_parser_enabled' || $key === 'enable_html5_parser') { | |
400 | return $this->getIsHtml5ParserEnabled(); | |
401 | } elseif ($key === 'isFontSubsettingEnabled' || $key === 'is_font_subsetting_enabled' || $key === 'enable_font_subsetting') { | |
402 | return $this->getIsFontSubsettingEnabled(); | |
403 | } elseif ($key === 'debugPng' || $key === 'debug_png') { | |
404 | return $this->getDebugPng(); | |
405 | } elseif ($key === 'debugKeepTemp' || $key === 'debug_keep_temp') { | |
406 | return $this->getDebugKeepTemp(); | |
407 | } elseif ($key === 'debugCss' || $key === 'debug_css') { | |
408 | return $this->getDebugCss(); | |
409 | } elseif ($key === 'debugLayout' || $key === 'debug_layout') { | |
410 | return $this->getDebugLayout(); | |
411 | } elseif ($key === 'debugLayoutLines' || $key === 'debug_layout_lines') { | |
412 | return $this->getDebugLayoutLines(); | |
413 | } elseif ($key === 'debugLayoutBlocks' || $key === 'debug_layout_blocks') { | |
414 | return $this->getDebugLayoutBlocks(); | |
415 | } elseif ($key === 'debugLayoutInline' || $key === 'debug_layout_inline') { | |
416 | return $this->getDebugLayoutInline(); | |
417 | } elseif ($key === 'debugLayoutPaddingBox' || $key === 'debug_layout_padding_box') { | |
418 | return $this->getDebugLayoutPaddingBox(); | |
419 | } elseif ($key === 'pdfBackend' || $key === 'pdf_backend') { | |
420 | return $this->getPdfBackend(); | |
421 | } elseif ($key === 'pdflibLicense' || $key === 'pdflib_license') { | |
422 | return $this->getPdflibLicense(); | |
423 | } elseif ($key === 'adminUsername' || $key === 'admin_username') { | |
424 | return $this->getAdminUsername(); | |
425 | } elseif ($key === 'adminPassword' || $key === 'admin_password') { | |
426 | return $this->getAdminPassword(); | |
427 | } | |
428 | return null; | |
429 | } | |
430 | ||
431 | /** | |
432 | * @param string $adminPassword | |
433 | * @return $this | |
434 | */ | |
435 | public function setAdminPassword($adminPassword) | |
436 | { | |
437 | $this->adminPassword = $adminPassword; | |
438 | return $this; | |
439 | } | |
440 | ||
441 | /** | |
442 | * @return string | |
443 | */ | |
444 | public function getAdminPassword() | |
445 | { | |
446 | return $this->adminPassword; | |
447 | } | |
448 | ||
449 | /** | |
450 | * @param string $adminUsername | |
451 | * @return $this | |
452 | */ | |
453 | public function setAdminUsername($adminUsername) | |
454 | { | |
455 | $this->adminUsername = $adminUsername; | |
456 | return $this; | |
457 | } | |
458 | ||
459 | /** | |
460 | * @return string | |
461 | */ | |
462 | public function getAdminUsername() | |
463 | { | |
464 | return $this->adminUsername; | |
465 | } | |
466 | ||
467 | /** | |
468 | * @param string $pdfBackend | |
469 | * @return $this | |
470 | */ | |
471 | public function setPdfBackend($pdfBackend) | |
472 | { | |
473 | $this->pdfBackend = $pdfBackend; | |
474 | return $this; | |
475 | } | |
476 | ||
477 | /** | |
478 | * @return string | |
479 | */ | |
480 | public function getPdfBackend() | |
481 | { | |
482 | return $this->pdfBackend; | |
483 | } | |
484 | ||
485 | /** | |
486 | * @param string $pdflibLicense | |
487 | * @return $this | |
488 | */ | |
489 | public function setPdflibLicense($pdflibLicense) | |
490 | { | |
491 | $this->pdflibLicense = $pdflibLicense; | |
492 | return $this; | |
493 | } | |
494 | ||
495 | /** | |
496 | * @return string | |
497 | */ | |
498 | public function getPdflibLicense() | |
499 | { | |
500 | return $this->pdflibLicense; | |
501 | } | |
502 | ||
503 | /** | |
504 | * @param string $chroot | |
505 | * @return $this | |
506 | */ | |
507 | public function setChroot($chroot) | |
508 | { | |
509 | $this->chroot = $chroot; | |
510 | return $this; | |
511 | } | |
512 | ||
513 | /** | |
514 | * @return string | |
515 | */ | |
516 | public function getChroot() | |
517 | { | |
518 | return $this->chroot; | |
519 | } | |
520 | ||
521 | /** | |
522 | * @param boolean $debugCss | |
523 | * @return $this | |
524 | */ | |
525 | public function setDebugCss($debugCss) | |
526 | { | |
527 | $this->debugCss = $debugCss; | |
528 | return $this; | |
529 | } | |
530 | ||
531 | /** | |
532 | * @return boolean | |
533 | */ | |
534 | public function getDebugCss() | |
535 | { | |
536 | return $this->debugCss; | |
537 | } | |
538 | ||
539 | /** | |
540 | * @param boolean $debugKeepTemp | |
541 | * @return $this | |
542 | */ | |
543 | public function setDebugKeepTemp($debugKeepTemp) | |
544 | { | |
545 | $this->debugKeepTemp = $debugKeepTemp; | |
546 | return $this; | |
547 | } | |
548 | ||
549 | /** | |
550 | * @return boolean | |
551 | */ | |
552 | public function getDebugKeepTemp() | |
553 | { | |
554 | return $this->debugKeepTemp; | |
555 | } | |
556 | ||
557 | /** | |
558 | * @param boolean $debugLayout | |
559 | * @return $this | |
560 | */ | |
561 | public function setDebugLayout($debugLayout) | |
562 | { | |
563 | $this->debugLayout = $debugLayout; | |
564 | return $this; | |
565 | } | |
566 | ||
567 | /** | |
568 | * @return boolean | |
569 | */ | |
570 | public function getDebugLayout() | |
571 | { | |
572 | return $this->debugLayout; | |
573 | } | |
574 | ||
575 | /** | |
576 | * @param boolean $debugLayoutBlocks | |
577 | * @return $this | |
578 | */ | |
579 | public function setDebugLayoutBlocks($debugLayoutBlocks) | |
580 | { | |
581 | $this->debugLayoutBlocks = $debugLayoutBlocks; | |
582 | return $this; | |
583 | } | |
584 | ||
585 | /** | |
586 | * @return boolean | |
587 | */ | |
588 | public function getDebugLayoutBlocks() | |
589 | { | |
590 | return $this->debugLayoutBlocks; | |
591 | } | |
592 | ||
593 | /** | |
594 | * @param boolean $debugLayoutInline | |
595 | * @return $this | |
596 | */ | |
597 | public function setDebugLayoutInline($debugLayoutInline) | |
598 | { | |
599 | $this->debugLayoutInline = $debugLayoutInline; | |
600 | return $this; | |
601 | } | |
602 | ||
603 | /** | |
604 | * @return boolean | |
605 | */ | |
606 | public function getDebugLayoutInline() | |
607 | { | |
608 | return $this->debugLayoutInline; | |
609 | } | |
610 | ||
611 | /** | |
612 | * @param boolean $debugLayoutLines | |
613 | * @return $this | |
614 | */ | |
615 | public function setDebugLayoutLines($debugLayoutLines) | |
616 | { | |
617 | $this->debugLayoutLines = $debugLayoutLines; | |
618 | return $this; | |
619 | } | |
620 | ||
621 | /** | |
622 | * @return boolean | |
623 | */ | |
624 | public function getDebugLayoutLines() | |
625 | { | |
626 | return $this->debugLayoutLines; | |
627 | } | |
628 | ||
629 | /** | |
630 | * @param boolean $debugLayoutPaddingBox | |
631 | * @return $this | |
632 | */ | |
633 | public function setDebugLayoutPaddingBox($debugLayoutPaddingBox) | |
634 | { | |
635 | $this->debugLayoutPaddingBox = $debugLayoutPaddingBox; | |
636 | return $this; | |
637 | } | |
638 | ||
639 | /** | |
640 | * @return boolean | |
641 | */ | |
642 | public function getDebugLayoutPaddingBox() | |
643 | { | |
644 | return $this->debugLayoutPaddingBox; | |
645 | } | |
646 | ||
647 | /** | |
648 | * @param boolean $debugPng | |
649 | * @return $this | |
650 | */ | |
651 | public function setDebugPng($debugPng) | |
652 | { | |
653 | $this->debugPng = $debugPng; | |
654 | return $this; | |
655 | } | |
656 | ||
657 | /** | |
658 | * @return boolean | |
659 | */ | |
660 | public function getDebugPng() | |
661 | { | |
662 | return $this->debugPng; | |
663 | } | |
664 | ||
665 | /** | |
666 | * @param string $defaultFont | |
667 | * @return $this | |
668 | */ | |
669 | public function setDefaultFont($defaultFont) | |
670 | { | |
671 | $this->defaultFont = $defaultFont; | |
672 | return $this; | |
673 | } | |
674 | ||
675 | /** | |
676 | * @return string | |
677 | */ | |
678 | public function getDefaultFont() | |
679 | { | |
680 | return $this->defaultFont; | |
681 | } | |
682 | ||
683 | /** | |
684 | * @param string $defaultMediaType | |
685 | * @return $this | |
686 | */ | |
687 | public function setDefaultMediaType($defaultMediaType) | |
688 | { | |
689 | $this->defaultMediaType = $defaultMediaType; | |
690 | return $this; | |
691 | } | |
692 | ||
693 | /** | |
694 | * @return string | |
695 | */ | |
696 | public function getDefaultMediaType() | |
697 | { | |
698 | return $this->defaultMediaType; | |
699 | } | |
700 | ||
701 | /** | |
702 | * @param string $defaultPaperSize | |
703 | * @return $this | |
704 | */ | |
705 | public function setDefaultPaperSize($defaultPaperSize) | |
706 | { | |
707 | $this->defaultPaperSize = $defaultPaperSize; | |
708 | return $this; | |
709 | } | |
710 | ||
711 | /** | |
712 | * @return string | |
713 | */ | |
714 | public function getDefaultPaperSize() | |
715 | { | |
716 | return $this->defaultPaperSize; | |
717 | } | |
718 | ||
719 | /** | |
720 | * @param int $dpi | |
721 | * @return $this | |
722 | */ | |
723 | public function setDpi($dpi) | |
724 | { | |
725 | $this->dpi = $dpi; | |
726 | return $this; | |
727 | } | |
728 | ||
729 | /** | |
730 | * @return int | |
731 | */ | |
732 | public function getDpi() | |
733 | { | |
734 | return $this->dpi; | |
735 | } | |
736 | ||
737 | /** | |
738 | * @param string $fontCache | |
739 | * @return $this | |
740 | */ | |
741 | public function setFontCache($fontCache) | |
742 | { | |
743 | $this->fontCache = $fontCache; | |
744 | return $this; | |
745 | } | |
746 | ||
747 | /** | |
748 | * @return string | |
749 | */ | |
750 | public function getFontCache() | |
751 | { | |
752 | return $this->fontCache; | |
753 | } | |
754 | ||
755 | /** | |
756 | * @param string $fontDir | |
757 | * @return $this | |
758 | */ | |
759 | public function setFontDir($fontDir) | |
760 | { | |
761 | $this->fontDir = $fontDir; | |
762 | return $this; | |
763 | } | |
764 | ||
765 | /** | |
766 | * @return string | |
767 | */ | |
768 | public function getFontDir() | |
769 | { | |
770 | return $this->fontDir; | |
771 | } | |
772 | ||
773 | /** | |
774 | * @param float $fontHeightRatio | |
775 | * @return $this | |
776 | */ | |
777 | public function setFontHeightRatio($fontHeightRatio) | |
778 | { | |
779 | $this->fontHeightRatio = $fontHeightRatio; | |
780 | return $this; | |
781 | } | |
782 | ||
783 | /** | |
784 | * @return float | |
785 | */ | |
786 | public function getFontHeightRatio() | |
787 | { | |
788 | return $this->fontHeightRatio; | |
789 | } | |
790 | ||
791 | /** | |
792 | * @param boolean $isFontSubsettingEnabled | |
793 | * @return $this | |
794 | */ | |
795 | public function setIsFontSubsettingEnabled($isFontSubsettingEnabled) | |
796 | { | |
797 | $this->isFontSubsettingEnabled = $isFontSubsettingEnabled; | |
798 | return $this; | |
799 | } | |
800 | ||
801 | /** | |
802 | * @return boolean | |
803 | */ | |
804 | public function getIsFontSubsettingEnabled() | |
805 | { | |
806 | return $this->isFontSubsettingEnabled; | |
807 | } | |
808 | ||
809 | /** | |
810 | * @return boolean | |
811 | */ | |
812 | public function isFontSubsettingEnabled() | |
813 | { | |
814 | return $this->getIsFontSubsettingEnabled(); | |
815 | } | |
816 | ||
817 | /** | |
818 | * @param boolean $isHtml5ParserEnabled | |
819 | * @return $this | |
820 | */ | |
821 | public function setIsHtml5ParserEnabled($isHtml5ParserEnabled) | |
822 | { | |
823 | $this->isHtml5ParserEnabled = $isHtml5ParserEnabled; | |
824 | return $this; | |
825 | } | |
826 | ||
827 | /** | |
828 | * @return boolean | |
829 | */ | |
830 | public function getIsHtml5ParserEnabled() | |
831 | { | |
832 | return $this->isHtml5ParserEnabled; | |
833 | } | |
834 | ||
835 | /** | |
836 | * @return boolean | |
837 | */ | |
838 | public function isHtml5ParserEnabled() | |
839 | { | |
840 | return $this->getIsHtml5ParserEnabled(); | |
841 | } | |
842 | ||
843 | /** | |
844 | * @param boolean $isJavascriptEnabled | |
845 | * @return $this | |
846 | */ | |
847 | public function setIsJavascriptEnabled($isJavascriptEnabled) | |
848 | { | |
849 | $this->isJavascriptEnabled = $isJavascriptEnabled; | |
850 | return $this; | |
851 | } | |
852 | ||
853 | /** | |
854 | * @return boolean | |
855 | */ | |
856 | public function getIsJavascriptEnabled() | |
857 | { | |
858 | return $this->isJavascriptEnabled; | |
859 | } | |
860 | ||
861 | /** | |
862 | * @return boolean | |
863 | */ | |
864 | public function isJavascriptEnabled() | |
865 | { | |
866 | return $this->getIsJavascriptEnabled(); | |
867 | } | |
868 | ||
869 | /** | |
870 | * @param boolean $isPhpEnabled | |
871 | * @return $this | |
872 | */ | |
873 | public function setIsPhpEnabled($isPhpEnabled) | |
874 | { | |
875 | $this->isPhpEnabled = $isPhpEnabled; | |
876 | return $this; | |
877 | } | |
878 | ||
879 | /** | |
880 | * @return boolean | |
881 | */ | |
882 | public function getIsPhpEnabled() | |
883 | { | |
884 | return $this->isPhpEnabled; | |
885 | } | |
886 | ||
887 | /** | |
888 | * @return boolean | |
889 | */ | |
890 | public function isPhpEnabled() | |
891 | { | |
892 | return $this->getIsPhpEnabled(); | |
893 | } | |
894 | ||
895 | /** | |
896 | * @param boolean $isRemoteEnabled | |
897 | * @return $this | |
898 | */ | |
899 | public function setIsRemoteEnabled($isRemoteEnabled) | |
900 | { | |
901 | $this->isRemoteEnabled = $isRemoteEnabled; | |
902 | return $this; | |
903 | } | |
904 | ||
905 | /** | |
906 | * @return boolean | |
907 | */ | |
908 | public function getIsRemoteEnabled() | |
909 | { | |
910 | return $this->isRemoteEnabled; | |
911 | } | |
912 | ||
913 | /** | |
914 | * @return boolean | |
915 | */ | |
916 | public function isRemoteEnabled() | |
917 | { | |
918 | return $this->getIsRemoteEnabled(); | |
919 | } | |
920 | ||
921 | /** | |
922 | * @param string $logOutputFile | |
923 | * @return $this | |
924 | */ | |
925 | public function setLogOutputFile($logOutputFile) | |
926 | { | |
927 | $this->logOutputFile = $logOutputFile; | |
928 | return $this; | |
929 | } | |
930 | ||
931 | /** | |
932 | * @return string | |
933 | */ | |
934 | public function getLogOutputFile() | |
935 | { | |
936 | return $this->logOutputFile; | |
937 | } | |
938 | ||
939 | /** | |
940 | * @param string $tempDir | |
941 | * @return $this | |
942 | */ | |
943 | public function setTempDir($tempDir) | |
944 | { | |
945 | $this->tempDir = $tempDir; | |
946 | return $this; | |
947 | } | |
948 | ||
949 | /** | |
950 | * @return string | |
951 | */ | |
952 | public function getTempDir() | |
953 | { | |
954 | return $this->tempDir; | |
955 | } | |
956 | ||
957 | /** | |
958 | * @param string $rootDir | |
959 | * @return $this | |
960 | */ | |
961 | public function setRootDir($rootDir) | |
962 | { | |
963 | $this->rootDir = $rootDir; | |
964 | return $this; | |
965 | } | |
966 | ||
967 | /** | |
968 | * @return string | |
969 | */ | |
970 | public function getRootDir() | |
971 | { | |
972 | return $this->rootDir; | |
973 | } | |
974 | } |