PHP Class CakePdf\Pdf\CakePdf

Afficher le fichier Open project: ceeram/cakepdf Class Usage Examples

Protected Properties

Свойство Type Description
$_allow mixed false: none true: all array: List of permissions that are allowed
$_availablePermissions array Available permissions
$_cache string | boolean Cache config name, if set to false cache is disabled
$_cryptoClass CakePdf\Pdf\Crypto\AbstractPdfCrypto Instance of PdfCrypto class
$_delay integer Javascript delay before rendering document in milliseconds
$_encoding string Encoding
$_engineClass CakePdf\Pdf\Engine\AbstractPdfEngine Instance of PdfEngine class
$_footer string Footer HTML
$_header string Header HTML
$_helpers array Helpers to be used in the render
$_html string Html to be rendered
$_layout string Layout for the View
$_layoutPath string Path to the layout - defaults to 'pdf'
$_marginBottom number Bottom margin in mm
$_marginLeft number Left margin in mm
$_marginRight number Right margin in mm
$_marginTop number Top margin in mm
$_orientation string Orientation of the pdf
$_ownerPassword boolean Owner password, used with crypto
$_pageSize string Page size of the pdf
$_protect boolean Flag that tells if we need to pass it through crypto
$_template string Template for the view
$_templatePath string Path to the template - defaults to 'Pdf'
$_theme array Theme for the View
$_title string Title of the document
$_userPassword boolean User password, used with crypto
$_viewRender string View for render
$_viewVars array Vars to sent to render
$_windowStatus string Window status required before rendering document

Méthodes publiques

Méthode Description
__construct ( array $config = [] ) Constructor
cache ( null | boolean | string $cache = null ) : mixed Get/Set caching.
crypto ( string $name = null ) : AbstractPdfCrypto Load PdfCrypto
delay ( null | integer $delay = null ) : mixed Get/Set javascript delay.
encoding ( null | string $encoding = null ) : mixed Get/Set Encoding.
engine ( string $name = null ) : CakePdf\Pdf\Engine\AbstractPdfEngine Load PdfEngine
footer ( null | string $left = null, null | string $center = null, null | string $right = null ) : mixed Get/Set footer HTML.
header ( null | string $left = null, null | string $center = null, null | string $right = null ) : mixed Get/Set header HTML.
helpers ( array $helpers = null ) : mixed Helpers to be used in render
html ( null | string $html = null ) : mixed Get/Set Html.
layoutPath ( mixed $layoutPath = false ) : mixed Layout path
margin ( null | string | array $bottom = null, null | string $left = null, null | string $right = null, null | string $top = null ) : mixed Get/Set page margins.
marginBottom ( null | string $margin = null ) : mixed Get/Set bottom margin.
marginLeft ( null | string $margin = null ) : mixed Get/Set left margin.
marginRight ( null | string $margin = null ) : mixed Get/Set right margin.
marginTop ( null | string $margin = null ) : mixed Get/Set top margin.
orientation ( null | string $orientation = null ) : mixed Get/Set Orientation.
output ( null | string $html = null ) : string Create pdf content from html. Can be used to write to file or with PdfView to display
ownerPassword ( null | string $password = null ) : mixed Get/Set ownerPassword.
pageSize ( null | string $pageSize = null ) : mixed Get/Set Page size.
permissions ( null | boolean | array $permissions = null ) : mixed Get/Set permissions.
protect ( null | boolean $protect = null ) : mixed Get/Set protection.
template ( mixed $template = false, mixed $layout = null ) : mixed Template and layout
templatePath ( mixed $templatePath = false ) : mixed Template path
theme ( string $theme = null ) : mixed Theme to use when rendering
title ( null | string $title = null ) : mixed Get/Set document title.
userPassword ( null | string $password = null ) : mixed Get/Set userPassword
viewRender ( string $viewClass = null ) : mixed View class for render
viewVars ( array $viewVars = null ) : mixed Variables to be set on render
windowStatus ( null | string $status = null ) : mixed Get/Set the required window status for rendering Waits until the status is equal to the string before rendering the pdf
write ( string $destination, boolean $create = true, string $html = null ) : boolean Writes output to file

Méthodes protégées

Méthode Description
_render ( ) : array Build and set all the view properties needed to render the layout and template.

Method Details

__construct() public méthode

Constructor
public __construct ( array $config = [] )
$config array Pdf configs to use

_render() protected méthode

Build and set all the view properties needed to render the layout and template.
protected _render ( ) : array
Résultat array The rendered template wrapped in layout.

cache() public méthode

Get/Set caching.
public cache ( null | boolean | string $cache = null ) : mixed
$cache null | boolean | string Cache config name to use, If true is passed, 'cake_pdf' will be used.
Résultat mixed

crypto() public méthode

Load PdfCrypto
public crypto ( string $name = null ) : AbstractPdfCrypto
$name string Classname of crypto engine without `Crypto` suffix. For example `CakePdf.Pdftk`
Résultat CakePdf\Pdf\Crypto\AbstractPdfCrypto

delay() public méthode

Get/Set javascript delay.
public delay ( null | integer $delay = null ) : mixed
$delay null | integer delay to set in milliseconds
Résultat mixed

encoding() public méthode

Get/Set Encoding.
public encoding ( null | string $encoding = null ) : mixed
$encoding null | string encoding to set
Résultat mixed

engine() public méthode

Load PdfEngine
public engine ( string $name = null ) : CakePdf\Pdf\Engine\AbstractPdfEngine
$name string Classname of pdf engine without `Engine` suffix. For example `CakePdf.DomPdf`
Résultat CakePdf\Pdf\Engine\AbstractPdfEngine

header() public méthode

Get/Set header HTML.
public header ( null | string $left = null, null | string $center = null, null | string $right = null ) : mixed
$left null | string left side header
$center null | string center header
$right null | string right side header
Résultat mixed

helpers() public méthode

Helpers to be used in render
public helpers ( array $helpers = null ) : mixed
$helpers array helpers to use
Résultat mixed

html() public méthode

Get/Set Html.
public html ( null | string $html = null ) : mixed
$html null | string Html to set
Résultat mixed

layoutPath() public méthode

Layout path
public layoutPath ( mixed $layoutPath = false ) : mixed
$layoutPath mixed The path of the layout file to use
Résultat mixed

margin() public méthode

Several options are available Array format ------------ First param can be an array with the following options: - bottom - left - right - top Set margin for all borders -------------------------- $bottom is set to a string Leave all other parameters empty Set margin for horizontal and vertical -------------------------------------- $bottom value will be set to bottom and top $left value will be set to left and right
public margin ( null | string | array $bottom = null, null | string $left = null, null | string $right = null, null | string $top = null ) : mixed
$bottom null | string | array bottom margin, or array of margins
$left null | string left margin
$right null | string right margin
$top null | string top margin
Résultat mixed

marginBottom() public méthode

Get/Set bottom margin.
public marginBottom ( null | string $margin = null ) : mixed
$margin null | string margin to set
Résultat mixed

marginLeft() public méthode

Get/Set left margin.
public marginLeft ( null | string $margin = null ) : mixed
$margin null | string margin to set
Résultat mixed

marginRight() public méthode

Get/Set right margin.
public marginRight ( null | string $margin = null ) : mixed
$margin null | string margin to set
Résultat mixed

marginTop() public méthode

Get/Set top margin.
public marginTop ( null | string $margin = null ) : mixed
$margin null | string margin to set
Résultat mixed

orientation() public méthode

Get/Set Orientation.
public orientation ( null | string $orientation = null ) : mixed
$orientation null | string orientation to set
Résultat mixed

output() public méthode

Create pdf content from html. Can be used to write to file or with PdfView to display
public output ( null | string $html = null ) : string
$html null | string Html content to render. If omitted, the template will be rendered with viewVars and layout that have been set.
Résultat string

ownerPassword() public méthode

The owner password is used to control who can modify, print, manage the PDF document.
public ownerPassword ( null | string $password = null ) : mixed
$password null | string password to set
Résultat mixed

pageSize() public méthode

Get/Set Page size.
public pageSize ( null | string $pageSize = null ) : mixed
$pageSize null | string Page size to set
Résultat mixed

permissions() public méthode

all: allow all permissions none: allow no permissions array: list of permissions that are allowed
public permissions ( null | boolean | array $permissions = null ) : mixed
$permissions null | boolean | array Permissions to set
Résultat mixed

protect() public méthode

Get/Set protection.
public protect ( null | boolean $protect = null ) : mixed
$protect null | boolean True or false
Résultat mixed

template() public méthode

Template and layout
public template ( mixed $template = false, mixed $layout = null ) : mixed
$template mixed Template name or null to not use
$layout mixed Layout name or null to not use
Résultat mixed

templatePath() public méthode

Template path
public templatePath ( mixed $templatePath = false ) : mixed
$templatePath mixed The path of the template to use
Résultat mixed

theme() public méthode

Theme to use when rendering
public theme ( string $theme = null ) : mixed
$theme string theme to use
Résultat mixed

title() public méthode

Get/Set document title.
public title ( null | string $title = null ) : mixed
$title null | string title to set
Résultat mixed

userPassword() public méthode

The user password is used to control who can open the PDF document.
public userPassword ( null | string $password = null ) : mixed
$password null | string password to set
Résultat mixed

viewRender() public méthode

View class for render
public viewRender ( string $viewClass = null ) : mixed
$viewClass string name of the view class to use
Résultat mixed

viewVars() public méthode

Variables to be set on render
public viewVars ( array $viewVars = null ) : mixed
$viewVars array view variables to set
Résultat mixed

windowStatus() public méthode

Get/Set the required window status for rendering Waits until the status is equal to the string before rendering the pdf
public windowStatus ( null | string $status = null ) : mixed
$status null | string status to set as string
Résultat mixed

write() public méthode

Writes output to file
public write ( string $destination, boolean $create = true, string $html = null ) : boolean
$destination string Absolute file path to write to
$create boolean Create file if it does not exist (if true)
$html string Html to write
Résultat boolean

Property Details

$_allow protected_oe property

false: none true: all array: List of permissions that are allowed
protected mixed $_allow
Résultat mixed

$_availablePermissions protected_oe property

Available permissions
protected array $_availablePermissions
Résultat array

$_cache protected_oe property

Cache config name, if set to false cache is disabled
protected string|bool $_cache
Résultat string | boolean

$_cryptoClass protected_oe property

Instance of PdfCrypto class
protected AbstractPdfCrypto,CakePdf\Pdf\Crypto $_cryptoClass
Résultat CakePdf\Pdf\Crypto\AbstractPdfCrypto

$_delay protected_oe property

Javascript delay before rendering document in milliseconds
protected int $_delay
Résultat integer

$_encoding protected_oe property

Encoding
protected string $_encoding
Résultat string

$_engineClass protected_oe property

Instance of PdfEngine class
protected AbstractPdfEngine,CakePdf\Pdf\Engine $_engineClass
Résultat CakePdf\Pdf\Engine\AbstractPdfEngine

$_header protected_oe property

Header HTML
protected string $_header
Résultat string

$_helpers protected_oe property

Helpers to be used in the render
protected array $_helpers
Résultat array

$_html protected_oe property

Html to be rendered
protected string $_html
Résultat string

$_layout protected_oe property

Layout for the View
protected string $_layout
Résultat string

$_layoutPath protected_oe property

Path to the layout - defaults to 'pdf'
protected string $_layoutPath
Résultat string

$_marginBottom protected_oe property

Bottom margin in mm
protected number $_marginBottom
Résultat number

$_marginLeft protected_oe property

Left margin in mm
protected number $_marginLeft
Résultat number

$_marginRight protected_oe property

Right margin in mm
protected number $_marginRight
Résultat number

$_marginTop protected_oe property

Top margin in mm
protected number $_marginTop
Résultat number

$_orientation protected_oe property

Orientation of the pdf
protected string $_orientation
Résultat string

$_ownerPassword protected_oe property

Owner password, used with crypto
protected bool $_ownerPassword
Résultat boolean

$_pageSize protected_oe property

Page size of the pdf
protected string $_pageSize
Résultat string

$_protect protected_oe property

Flag that tells if we need to pass it through crypto
protected bool $_protect
Résultat boolean

$_template protected_oe property

Template for the view
protected string $_template
Résultat string

$_templatePath protected_oe property

Path to the template - defaults to 'Pdf'
protected string $_templatePath
Résultat string

$_theme protected_oe property

Theme for the View
protected array $_theme
Résultat array

$_title protected_oe property

Title of the document
protected string $_title
Résultat string

$_userPassword protected_oe property

User password, used with crypto
protected bool $_userPassword
Résultat boolean

$_viewRender protected_oe property

View for render
protected string $_viewRender
Résultat string

$_viewVars protected_oe property

Vars to sent to render
protected array $_viewVars
Résultat array

$_windowStatus protected_oe property

Window status required before rendering document
protected string $_windowStatus
Résultat string