expWKPDF
extends expHtmlToPDF
in package
This is the class expHtmlToPDF
Tags
Table of Contents
- $pdf : mixed
- Private use variables.
- $PDF_ASSTRING : mixed
- Returns the PDF file as a string.
- $PDF_DOWNLOAD : mixed
- Force the client to download PDF file.
- $PDF_EMBEDDED : mixed
- When possible, force the client to embed (display) PDF file.
- $PDF_LANDSCAPE : mixed
- PDF generated as landscape (horizontal).
- $PDF_PORTRAIT : mixed
- PDF generated as landscape (vertical).
- $PDF_SAVEFILE : mixed
- PDF file is saved into the server space. The path is returned.
- $orient : mixed
- $size : mixed
- $cmd : mixed
- $copies : mixed
- $cpu : mixed
- $grayscale : mixed
- $html : mixed
- Private use variables.
- $status : mixed
- $title : mixed
- $tmp : mixed
- $toc : mixed
- __construct() : mixed
- Constructor: initialize command line and reserve temporary file.
- __get() : null
- Generic magic method
- __isset() : bool
- Generic magic method
- __set() : mixed
- Generic magic method We MUST create/set non-existing properties for Exponent code to work
- __unset() : mixed
- Generic magic method
- createpdf() : string|bool
- Return PDF with various options.
- get_help() : string
- Attempts to return the library's full help.
- get_status() : string
- Returns WKPDF print status.
- installed() : mixed
- Return status of pdf engine being installed correctly
- render() : mixed
- Convert HTML to PDF.
- set_copies() : mixed
- Set the number of copies to be printed.
- set_html() : mixed
- Set html content.
- set_html_file() : mixed
- Set html content by file.
- set_orientation() : mixed
- Set orientation, use constants from this class.
- set_page_size() : mixed
- Set page/paper size.
- set_toc() : mixed
- Whether to automatically generate a TOC (table of contents) or not.
- _getCPU() : string
- Function that attempts to return the kind of CPU.
- _pipeExec() : array<string|int, mixed>
- Advanced execution routine.
Properties
Private use variables.
public
mixed
$pdf
= \null
$PDF_ASSTRING
Returns the PDF file as a string.
public
static mixed
$PDF_ASSTRING
= 'S'
$PDF_DOWNLOAD
Force the client to download PDF file.
public
static mixed
$PDF_DOWNLOAD
= 'D'
$PDF_EMBEDDED
When possible, force the client to embed (display) PDF file.
public
static mixed
$PDF_EMBEDDED
= 'I'
$PDF_LANDSCAPE
PDF generated as landscape (horizontal).
public
static mixed
$PDF_LANDSCAPE
= 'landscape'
$PDF_PORTRAIT
PDF generated as landscape (vertical).
public
static mixed
$PDF_PORTRAIT
= 'portrait'
$PDF_SAVEFILE
PDF file is saved into the server space. The path is returned.
public
static mixed
$PDF_SAVEFILE
= 'F'
$orient
protected
mixed
$orient
= 'portrait'
$size
protected
mixed
$size
= \HTMLTOPDF_PAPER
$cmd
private
mixed
$cmd
= ''
$copies
private
mixed
$copies
= 1
$cpu
private
static mixed
$cpu
= ''
$grayscale
private
mixed
$grayscale
= \false
$html
Private use variables.
private
mixed
$html
= ''
$status
private
mixed
$status
= ''
$title
private
mixed
$title
= ''
$tmp
private
mixed
$tmp
= ''
$toc
private
mixed
$toc
= \false
Methods
__construct()
Constructor: initialize command line and reserve temporary file.
public
__construct([string $paper_size = HTMLTOPDF_PAPER ][, string $orientation = "portrait" ][, null $html = null ][, bool $use_file = false ]) : mixed
Parameters
- $paper_size : string = HTMLTOPDF_PAPER
- $orientation : string = "portrait"
- $html : null = null
- $use_file : bool = false
Tags
Return values
mixed —__get()
Generic magic method
public
__get( $property) : null
Parameters
Return values
null —__isset()
Generic magic method
public
__isset( $property) : bool
Parameters
Return values
bool —__set()
Generic magic method We MUST create/set non-existing properties for Exponent code to work
public
__set( $property, $value) : mixed
Parameters
Return values
mixed —__unset()
Generic magic method
public
__unset( $property) : mixed
Parameters
Return values
mixed —createpdf()
Return PDF with various options.
public
createpdf(string $mode, string $file) : string|bool
Parameters
- $mode : string
-
How two output (constants from this same class).
- $file : string
-
The PDF's filename (the usage depends on $mode.
Tags
Return values
string|bool —Depending on $mode, this may be success (boolean) or PDF (string).
get_help()
Attempts to return the library's full help.
public
get_help() : string
Return values
string —WKHTMLTOPDF HTML help.
get_status()
Returns WKPDF print status.
public
get_status() : string
Return values
string —WPDF print status.
installed()
Return status of pdf engine being installed correctly
public
static installed() : mixed
Return values
mixed —render()
Convert HTML to PDF.
public
render() : mixed
Tags
Return values
mixed —set_copies()
Set the number of copies to be printed.
public
set_copies(int $count) : mixed
By default it is one.
Parameters
- $count : int
-
Number of page copies.
Return values
mixed —set_html()
Set html content.
public
set_html(string $html) : mixed
Parameters
- $html : string
-
New html content. It replaces any previous content.
Return values
mixed —set_html_file()
Set html content by file.
public
set_html_file(string $htmlfile) : mixed
Parameters
- $htmlfile : string
-
the html file to use
Return values
mixed —set_orientation()
Set orientation, use constants from this class.
public
set_orientation(string $mode) : mixed
By default orientation is portrait.
Parameters
- $mode : string
-
Use constants from this class.
Return values
mixed —set_page_size()
Set page/paper size.
public
set_page_size(string $size) : mixed
Parameters
- $size : string
-
Formal paper size (eg; A4, letter...)
Return values
mixed —set_toc()
Whether to automatically generate a TOC (table of contents) or not.
public
set_toc(bool $enabled) : mixed
By default TOC is disabled.
Parameters
- $enabled : bool
-
True use TOC, false disable TOC.
Return values
mixed —_getCPU()
Function that attempts to return the kind of CPU.
private
static _getCPU() : string
Tags
Return values
string —CPU kind ('amd64' or 'i386').
_pipeExec()
Advanced execution routine.
private
static _pipeExec(string $cmd[, string $input = '' ]) : array<string|int, mixed>
Parameters
- $cmd : string
-
The command to execute.
- $input : string = ''
-
Any input not in arguments.
Return values
array<string|int, mixed> —An array of execution data; stdout, stderr and return "error" code.