PHP Класс CakePdf\Pdf\CakePdf

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_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

Открытые методы

Метод Описание
__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

Защищенные методы

Метод Описание
_render ( ) : array Build and set all the view properties needed to render the layout and template.

Описание методов

__construct() публичный метод

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

_render() защищенный метод

Build and set all the view properties needed to render the layout and template.
protected _render ( ) : array
Результат array The rendered template wrapped in layout.

cache() публичный метод

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.
Результат mixed

crypto() публичный метод

Load PdfCrypto
public crypto ( string $name = null ) : AbstractPdfCrypto
$name string Classname of crypto engine without `Crypto` suffix. For example `CakePdf.Pdftk`
Результат CakePdf\Pdf\Crypto\AbstractPdfCrypto

delay() публичный метод

Get/Set javascript delay.
public delay ( null | integer $delay = null ) : mixed
$delay null | integer delay to set in milliseconds
Результат mixed

encoding() публичный метод

Get/Set Encoding.
public encoding ( null | string $encoding = null ) : mixed
$encoding null | string encoding to set
Результат mixed

engine() публичный метод

Load PdfEngine
public engine ( string $name = null ) : CakePdf\Pdf\Engine\AbstractPdfEngine
$name string Classname of pdf engine without `Engine` suffix. For example `CakePdf.DomPdf`
Результат CakePdf\Pdf\Engine\AbstractPdfEngine

header() публичный метод

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
Результат mixed

helpers() публичный метод

Helpers to be used in render
public helpers ( array $helpers = null ) : mixed
$helpers array helpers to use
Результат mixed

html() публичный метод

Get/Set Html.
public html ( null | string $html = null ) : mixed
$html null | string Html to set
Результат mixed

layoutPath() публичный метод

Layout path
public layoutPath ( mixed $layoutPath = false ) : mixed
$layoutPath mixed The path of the layout file to use
Результат mixed

margin() публичный метод

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
Результат mixed

marginBottom() публичный метод

Get/Set bottom margin.
public marginBottom ( null | string $margin = null ) : mixed
$margin null | string margin to set
Результат mixed

marginLeft() публичный метод

Get/Set left margin.
public marginLeft ( null | string $margin = null ) : mixed
$margin null | string margin to set
Результат mixed

marginRight() публичный метод

Get/Set right margin.
public marginRight ( null | string $margin = null ) : mixed
$margin null | string margin to set
Результат mixed

marginTop() публичный метод

Get/Set top margin.
public marginTop ( null | string $margin = null ) : mixed
$margin null | string margin to set
Результат mixed

orientation() публичный метод

Get/Set Orientation.
public orientation ( null | string $orientation = null ) : mixed
$orientation null | string orientation to set
Результат mixed

output() публичный метод

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.
Результат string

ownerPassword() публичный метод

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
Результат mixed

pageSize() публичный метод

Get/Set Page size.
public pageSize ( null | string $pageSize = null ) : mixed
$pageSize null | string Page size to set
Результат mixed

permissions() публичный метод

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
Результат mixed

protect() публичный метод

Get/Set protection.
public protect ( null | boolean $protect = null ) : mixed
$protect null | boolean True or false
Результат mixed

template() публичный метод

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
Результат mixed

templatePath() публичный метод

Template path
public templatePath ( mixed $templatePath = false ) : mixed
$templatePath mixed The path of the template to use
Результат mixed

theme() публичный метод

Theme to use when rendering
public theme ( string $theme = null ) : mixed
$theme string theme to use
Результат mixed

title() публичный метод

Get/Set document title.
public title ( null | string $title = null ) : mixed
$title null | string title to set
Результат mixed

userPassword() публичный метод

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
Результат mixed

viewRender() публичный метод

View class for render
public viewRender ( string $viewClass = null ) : mixed
$viewClass string name of the view class to use
Результат mixed

viewVars() публичный метод

Variables to be set on render
public viewVars ( array $viewVars = null ) : mixed
$viewVars array view variables to set
Результат mixed

windowStatus() публичный метод

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
Результат mixed

write() публичный метод

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
Результат boolean

Описание свойств

$_allow защищенное свойство

false: none true: all array: List of permissions that are allowed
protected mixed $_allow
Результат mixed

$_availablePermissions защищенное свойство

Available permissions
protected array $_availablePermissions
Результат array

$_cache защищенное свойство

Cache config name, if set to false cache is disabled
protected string|bool $_cache
Результат string | boolean

$_cryptoClass защищенное свойство

Instance of PdfCrypto class
protected AbstractPdfCrypto,CakePdf\Pdf\Crypto $_cryptoClass
Результат CakePdf\Pdf\Crypto\AbstractPdfCrypto

$_delay защищенное свойство

Javascript delay before rendering document in milliseconds
protected int $_delay
Результат integer

$_encoding защищенное свойство

Encoding
protected string $_encoding
Результат string

$_engineClass защищенное свойство

Instance of PdfEngine class
protected AbstractPdfEngine,CakePdf\Pdf\Engine $_engineClass
Результат CakePdf\Pdf\Engine\AbstractPdfEngine

$_header защищенное свойство

Header HTML
protected string $_header
Результат string

$_helpers защищенное свойство

Helpers to be used in the render
protected array $_helpers
Результат array

$_html защищенное свойство

Html to be rendered
protected string $_html
Результат string

$_layout защищенное свойство

Layout for the View
protected string $_layout
Результат string

$_layoutPath защищенное свойство

Path to the layout - defaults to 'pdf'
protected string $_layoutPath
Результат string

$_marginBottom защищенное свойство

Bottom margin in mm
protected number $_marginBottom
Результат number

$_marginLeft защищенное свойство

Left margin in mm
protected number $_marginLeft
Результат number

$_marginRight защищенное свойство

Right margin in mm
protected number $_marginRight
Результат number

$_marginTop защищенное свойство

Top margin in mm
protected number $_marginTop
Результат number

$_orientation защищенное свойство

Orientation of the pdf
protected string $_orientation
Результат string

$_ownerPassword защищенное свойство

Owner password, used with crypto
protected bool $_ownerPassword
Результат boolean

$_pageSize защищенное свойство

Page size of the pdf
protected string $_pageSize
Результат string

$_protect защищенное свойство

Flag that tells if we need to pass it through crypto
protected bool $_protect
Результат boolean

$_template защищенное свойство

Template for the view
protected string $_template
Результат string

$_templatePath защищенное свойство

Path to the template - defaults to 'Pdf'
protected string $_templatePath
Результат string

$_theme защищенное свойство

Theme for the View
protected array $_theme
Результат array

$_title защищенное свойство

Title of the document
protected string $_title
Результат string

$_userPassword защищенное свойство

User password, used with crypto
protected bool $_userPassword
Результат boolean

$_viewRender защищенное свойство

View for render
protected string $_viewRender
Результат string

$_viewVars защищенное свойство

Vars to sent to render
protected array $_viewVars
Результат array

$_windowStatus защищенное свойство

Window status required before rendering document
protected string $_windowStatus
Результат string