Options.php 27 KB

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