Definition at line 105 of file pdf.inc.
◆ __construct()
ChromePDFConvertor::__construct |
( |
|
$pdf | ) |
|
◆ coverPage()
ChromePDFConvertor::coverPage |
( |
|
$url | ) |
|
Provides a separate URL to use as the cover page of the PDF.
- Parameters
-
string | $url | the URL used to generate the cover page |
- Returns
- PDF
Implements PDFConvertor.
Definition at line 120 of file pdf.inc.
◆ footer()
ChromePDFConvertor::footer |
( |
|
$text, |
|
|
|
$position = "center" , |
|
|
|
$size = 11 |
|
) |
| |
- Parameters
-
$text | - text of the footer |
$position | - valid positions are left, right, and center |
$size | - font size for the footer ?? doesn't work |
Implements PDFConvertor.
Definition at line 132 of file pdf.inc.
134 $this->
footer =
"--footer-font-size {$size} --footer-{$position} \"{$text}\"";
footer($text, $position="center", $size=11)
◆ generate()
ChromePDFConvertor::generate |
( |
| ) |
|
Implements PDFConvertor.
Definition at line 137 of file pdf.inc.
145 $uri = $this->pdf->uri;
146 $uri = appendToQueryString(
$uri,
"__pdfoutput=1");
147 if ($this->pdf->landscape)
149 $uri = appendToQueryString(
$uri,
"__pdflayout=landscape");
152 if ($this->pdf->useToken)
155 $uri =
"/action/auto_login/authenticate?token=$token";
158 $url =
"http".($this->pdf->ssl?
"s":
"").
"://".
$config[
"http_host"].
$uri;
160 $flags =
"--headless --disable-gpu --no-margins --virtual-time-budget=2000";
162 $tmpName = sha1(
$url . now()) .
".pdf";
165 $cmd =
"{$exe} {$flags} \"{$url}\" --print-to-pdf={$output}";
173 trace(implode(
"\n",
$out), 3);
176 if (!$this->pdf->output) unlink(
$output);
static createOneTimeToken($url, $ip_addr=null)
FakoliException is the base exception class for all Fakoli errors.
static getTempDirectory()
static getValue($component, $name)
Retrieve the value of the specified Setting.
if(array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER)) $content
◆ preProcessTemplate()
ChromePDFConvertor::preProcessTemplate |
( |
|
$template | ) |
|
Definition at line 225 of file pdf.inc.
227 if (!isset($_GET[
"__pdfoutput"]))
return $template;
228 $layout = ($_GET[
"__pdflayout"] ==
"landscape") ?
" @page { size: landscape; }" :
"";
229 $styles =
"<style type='text/css' media='print'>{$layout} @page {margin:0;} body { margin: 1.5cm }</style></head>";
231 $template = preg_replace(
"/<\\/head>/i",
$styles, $template);
◆ screenshot()
ChromePDFConvertor::screenshot |
( |
| ) |
|
Implements PDFConvertor.
Definition at line 181 of file pdf.inc.
189 $uri = $this->pdf->uri;
190 $uri = appendToQueryString(
$uri,
"__pdfoutput=1");
191 if ($this->pdf->landscape)
193 $uri = appendToQueryString(
$uri,
"__pdflayout=landscape");
196 if ($this->pdf->useToken)
199 $uri =
"/action/auto_login/authenticate?token=$token";
202 $url =
"http".($this->pdf->ssl?
"s":
"").
"://".
$config[
"http_host"].
$uri;
206 $tmpName = sha1(
$url . now()) .
".png";
209 $cmd =
"{$exe} {$flags} \"{$url}\" {$output}";
217 trace(implode(
"\n",
$out), 3);
220 if (!$this->pdf->output) unlink(
$output);
The documentation for this class was generated from the following file:
- C:/code/cms.sonjara.com/cms/components/pdf/pdf.inc