PluginProbe
Easy Invoice – Invoice Generator, PDF Quotes & Payments / 2.4.3
Easy Invoice – Invoice Generator, PDF Quotes & Payments v2.4.3
2.4.3 2.4.4 2.4.2 2.4.0 2.4.1 2.3.8 2.3.7 2.3.6 2.3.5 2.3.4 2.3.3 2.3.2 2.3.1 2.2.0 2.1.21 2.1.20 2.1.19 2.1.18 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 All 60 releases
easy-invoice / vendor / dompdf / dompdf / src / JavascriptEmbedder.php

JavascriptEmbedder.php in Easy Invoice – Invoice Generator, PDF Quotes & Payments 2.4.3, at vendor/dompdf/dompdf/src/JavascriptEmbedder.php

52 lines 929 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package dompdf
4 * @link https://github.com/dompdf/dompdf
5 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
6 */
7 namespace Dompdf;
8
9 /**
10 * Embeds Javascript into the PDF document
11 *
12 * @package dompdf
13 */
14 class JavascriptEmbedder
15 {
16
17 /**
18 * @var Dompdf
19 */
20 protected $_dompdf;
21
22 /**
23 * JavascriptEmbedder constructor.
24 *
25 * @param Dompdf $dompdf
26 */
27 public function __construct(Dompdf $dompdf)
28 {
29 $this->_dompdf = $dompdf;
30 }
31
32 /**
33 * @param $script
34 */
35 public function insert($script)
36 {
37 $this->_dompdf->getCanvas()->javascript($script);
38 }
39
40 /**
41 * @param Frame $frame
42 */
43 public function render(Frame $frame)
44 {
45 if (!$this->_dompdf->getOptions()->getIsJavascriptEnabled()) {
46 return;
47 }
48
49 $this->insert($frame->get_node()->nodeValue);
50 }
51 }
52