init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
42
scripts/PDF_Javascript.php
Normal file
42
scripts/PDF_Javascript.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
require('fpdf.php');
|
||||
|
||||
class PDF_Javascript extends FPDF {
|
||||
|
||||
var $javascript;
|
||||
var $n_js;
|
||||
|
||||
function IncludeJS($script) {
|
||||
$this->javascript=$script;
|
||||
}
|
||||
|
||||
function _putjavascript() {
|
||||
$this->_newobj();
|
||||
$this->n_js=$this->n;
|
||||
$this->_out('<<');
|
||||
$this->_out('/Names [(EmbeddedJS) '.($this->n+1).' 0 R ]');
|
||||
$this->_out('>>');
|
||||
$this->_out('endobj');
|
||||
$this->_newobj();
|
||||
$this->_out('<<');
|
||||
$this->_out('/S /JavaScript');
|
||||
$this->_out('/JS '.$this->_textstring($this->javascript));
|
||||
$this->_out('>>');
|
||||
$this->_out('endobj');
|
||||
}
|
||||
|
||||
function _putresources() {
|
||||
parent::_putresources();
|
||||
if (!empty($this->javascript)) {
|
||||
$this->_putjavascript();
|
||||
}
|
||||
}
|
||||
|
||||
function _putcatalog() {
|
||||
parent::_putcatalog();
|
||||
if (isset($this->javascript)) {
|
||||
$this->_out('/Names <</JavaScript '.($this->n_js).' 0 R>>');
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue