expMPDF61

Extends \expHtmlToPDF

This is the class expHtmlToPDF

define

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

package

Default

Methods

Constructor: initialize a pdf file using selected engine.

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

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
inherited

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() 
inherited static

Return PDF as a string.

output(integer $compress = null) : string

Arguments

$compress

integer

compress the output

Response

string

Convert HTML to PDF.

render() 
inherited

set_grayscale

set_grayscale( $mode) 

Arguments

$mode

Set html content.

set_html(string $html) 
inherited

Arguments

$html

string

New html content. It replaces any previous content.

Set html content by file.

set_html_file(string $htmlfile) 
inherited

Arguments

$htmlfile

string

the html file to use

Set orientation, use constants from this class.

set_orientation(string $orientation) 
inherited

By default orientation is portrait.

Arguments

$orientation

string

orientation of paper

Set page/paper size.

set_page_size(string $size) 
inherited

By default page size is A4.

Arguments

$size

string

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

Set page/paper size.

set_paper(string $size, string $orientation = 'portrait') 

By default page size is A4.

Arguments

$size

string

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

$orientation

string

orientation of paper

Streams the PDF to the client.

stream(string $filename, array $options = null) 

Arguments

$filename

string

the pdf file to output

$options

array

options 'compress' = > 1 or 0 - apply content stream compression, this is on (1) by default ◦ 'Attachment' => 1 or 0 - if 1, force the browser to open a download dialog, on (1) by default

Properties

Private use variables.

pdf : 
inherited

Type(s)

size

size : 
inherited

Type(s)

orient

orient : 
inherited

Type(s)

Force the client to download PDF file.

PDF_DOWNLOAD : 
inherited static

Type(s)

Returns the PDF file as a string.

PDF_ASSTRING : 
inherited static

Type(s)

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

PDF_EMBEDDED : 
inherited static

Type(s)

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

PDF_SAVEFILE : 
inherited static

Type(s)

PDF generated as landscape (vertical).

PDF_PORTRAIT : 
inherited static

Type(s)

PDF generated as landscape (horizontal).

PDF_LANDSCAPE : 
inherited static

Type(s)