Options.php 26 KB

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