expHtmlToPDF

define

"BASE" "../../.."

package

Subsystems

Methods

Constructor: initialize a pdf file using selected engine.

__construct(string $paper_size = HTMLTOPDF_PAPER, string $orientation = "portrait", string $html = null, boolean $use_file = false) 

Arguments

$paper_size

string

page size

$orientation

string

page orientation

$html

string

html code for page

$use_file

boolean

a flag to show $html is an html file location to be loaded

Render and Return PDF using various options.

createpdf(string $mode, string $file) : string|boolean

Arguments

$mode

string

How to output (constants from this same class).

$file

string

The PDF's filename (the usage depends on $mode.

Response

string|boolean

Depending on $mode, this may be success (boolean) or PDF (string).

Return status of pdf engine being installed correctly

installed() 
static

Convert HTML to PDF.

render() 

Set html content.

set_html(string $html) 

Arguments

$html

string

New html content. It replaces any previous content.

Set html content by file.

set_html_file(string $htmlfile) 

Arguments

$htmlfile

string

the html file to use

Set orientation, use constants from this class.

set_orientation(string $orientation) 

By default orientation is portrait.

Arguments

$orientation

string

orientation of paper

Set page/paper size.

set_page_size(string $size) 

Arguments

$size

string

Formal paper size (eg; A4, letter...)

Properties

Private use variables.

pdf : 

Type(s)

size

size : 

Type(s)

orient

orient : 

Type(s)

Force the client to download PDF file.

PDF_DOWNLOAD : 
static

Type(s)

Returns the PDF file as a string.

PDF_ASSTRING : 
static

Type(s)

When possible, force the client to embed (display) PDF file.

PDF_EMBEDDED : 
static

Type(s)

PDF file is saved into the server space. The path is returned.

PDF_SAVEFILE : 
static

Type(s)

PDF generated as landscape (vertical).

PDF_PORTRAIT : 
static

Type(s)

PDF generated as landscape (horizontal).

PDF_LANDSCAPE : 
static

Type(s)