PHP 클래스 kartik\mpdf\Pdf

부터: 1.0
저자: Kartik Visweswaran ([email protected])
상속: extends yii\base\Component
파일 보기 프로젝트 열기: kartik-v/yii2-mpdf 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$content the HTML content to be converted to PDF
$cssFile css file to prepend to the PDF
$cssInline additional inline css to append after the cssFile
$defaultFont sets the default font-family for the new document. Uses default value set in defaultCSS unless codepage has been set to "win-1252". If codepage="win-1252", the appropriate core Adobe font will be set i.e. Helvetica, Times, or Courier.
$defaultFontSize sets the default document font size in points (pt)
$destination the output destination
$filename the output filename
$format
$marginBottom sets the page bottom margin for the new document (in millimetres).
$marginFooter sets the page footer margin for the new document (in millimetres).
$marginHeader sets the page header margin for the new document (in millimetres).
$marginLeft sets the page left margin for the new document. All values should be specified as LENGTH in millimetres. If you are creating a DOUBLE-SIDED document, the margin values specified will be used for ODD pages; left and right margins will be mirrored for EVEN pages.
$marginRight sets the page right margin for the new document (in millimetres).
$marginTop sets the page top margin for the new document (in millimetres).
$methods the mPDF methods that will called in the sequence listed before rendering the content. Should be an associative array of $method => $params format, where: - $method: string, is the mPDF method / function name - $param: mixed, are the mPDF method parameters
$mode specifies the mode of the new document. If the mode is set by passing a country/language string, this may also set: available fonts, text justification, and directionality RTL.
$options the mPDF configuration options entered as a $key => value associative array, where: - $key: string is the mPDF configuration property name - $value: mixed is the mPDF configured property value
$orientation specifies the default page orientation of the new document.
$tempPath the folder path for storing the temporary data generated by mpdf. If not set this defaults to Yii::getAlias('@runtime/mpdf').

보호된 프로퍼티들

프로퍼티 타입 설명
$_css the css file content
$_mpdf api instance
$_pdfAttachements Array of file-pathes that should be attached to the generated PDF

공개 메소드들

메소드 설명
addPdfAttachement ( string $filePath ) add an PDF to attach to the generated PDF
configure ( $options = [] ) Configures mPDF options
execute ( $method, $params = [] ) : mixed Calls the mPDF method with parameters
getApi ( ) : mPDF Initializes (if needed) and fetches the mPDF API instance
getCss ( ) : string Fetches the content of the CSS file if supplied
getPdfAttachements ( ) : array
init ( )
initTempPaths ( ) Initialize folder paths to allow mpdf to write temporary data.
output ( $content = '', $file = '', $dest = self::DEST_BROWSER ) : mixed Generates a PDF output
render ( ) Renders and returns the PDF output. Uses the class level property settings.
setApi ( ) Sets the mPDF API instance

보호된 메소드들

메소드 설명
definePath ( string $prop, string $dir ) : boolean Defines a mPDF temporary path if not set
parseFormat ( ) Parse the format automatically based on the orientation

비공개 메소드들

메소드 설명
writePdfAttachement ( mPDF $api, String $attachement ) appends the given attachement to the generated PDF

메소드 상세

addPdfAttachement() 공개 메소드

add an PDF to attach to the generated PDF
public addPdfAttachement ( string $filePath )
$filePath string

configure() 공개 메소드

Configures mPDF options
public configure ( $options = [] )

definePath() 보호된 정적인 메소드

Defines a mPDF temporary path if not set
protected static definePath ( string $prop, string $dir ) : boolean
$prop string the mPDF constant to define
$dir string the directory to create
리턴 boolean

execute() 공개 메소드

Calls the mPDF method with parameters
public execute ( $method, $params = [] ) : mixed
리턴 mixed

getApi() 공개 메소드

Initializes (if needed) and fetches the mPDF API instance
public getApi ( ) : mPDF
리턴 mPDF instance

getCss() 공개 메소드

Fetches the content of the CSS file if supplied
public getCss ( ) : string
리턴 string

getPdfAttachements() 공개 메소드

public getPdfAttachements ( ) : array
리턴 array Array of attachements

init() 공개 메소드

public init ( )

initTempPaths() 공개 메소드

Initialize folder paths to allow mpdf to write temporary data.
public initTempPaths ( )

output() 공개 메소드

Generates a PDF output
public output ( $content = '', $file = '', $dest = self::DEST_BROWSER ) : mixed
리턴 mixed

parseFormat() 보호된 메소드

Parse the format automatically based on the orientation
protected parseFormat ( )

render() 공개 메소드

Renders and returns the PDF output. Uses the class level property settings.
public render ( )

setApi() 공개 메소드

Sets the mPDF API instance
public setApi ( )

프로퍼티 상세

$_css 보호되어 있는 프로퍼티

the css file content
protected $_css

$_mpdf 보호되어 있는 프로퍼티

api instance
protected $_mpdf

$_pdfAttachements 보호되어 있는 프로퍼티

Array of file-pathes that should be attached to the generated PDF
protected $_pdfAttachements

$content 공개적으로 프로퍼티

the HTML content to be converted to PDF
public $content

$cssFile 공개적으로 프로퍼티

css file to prepend to the PDF
public $cssFile

$cssInline 공개적으로 프로퍼티

additional inline css to append after the cssFile
public $cssInline

$defaultFont 공개적으로 프로퍼티

sets the default font-family for the new document. Uses default value set in defaultCSS unless codepage has been set to "win-1252". If codepage="win-1252", the appropriate core Adobe font will be set i.e. Helvetica, Times, or Courier.
public $defaultFont

$defaultFontSize 공개적으로 프로퍼티

sets the default document font size in points (pt)
public $defaultFontSize

$destination 공개적으로 프로퍼티

the output destination
public $destination

$filename 공개적으로 프로퍼티

the output filename
public $filename

$format 공개적으로 프로퍼티

public $format

$marginBottom 공개적으로 프로퍼티

sets the page bottom margin for the new document (in millimetres).
public $marginBottom

$marginFooter 공개적으로 프로퍼티

sets the page footer margin for the new document (in millimetres).
public $marginFooter

$marginHeader 공개적으로 프로퍼티

sets the page header margin for the new document (in millimetres).
public $marginHeader

$marginLeft 공개적으로 프로퍼티

sets the page left margin for the new document. All values should be specified as LENGTH in millimetres. If you are creating a DOUBLE-SIDED document, the margin values specified will be used for ODD pages; left and right margins will be mirrored for EVEN pages.
public $marginLeft

$marginRight 공개적으로 프로퍼티

sets the page right margin for the new document (in millimetres).
public $marginRight

$marginTop 공개적으로 프로퍼티

sets the page top margin for the new document (in millimetres).
public $marginTop

$methods 공개적으로 프로퍼티

the mPDF methods that will called in the sequence listed before rendering the content. Should be an associative array of $method => $params format, where: - $method: string, is the mPDF method / function name - $param: mixed, are the mPDF method parameters
public $methods

$mode 공개적으로 프로퍼티

specifies the mode of the new document. If the mode is set by passing a country/language string, this may also set: available fonts, text justification, and directionality RTL.
public $mode

$options 공개적으로 프로퍼티

the mPDF configuration options entered as a $key => value associative array, where: - $key: string is the mPDF configuration property name - $value: mixed is the mPDF configured property value
public $options

$orientation 공개적으로 프로퍼티

specifies the default page orientation of the new document.
public $orientation

$tempPath 공개적으로 프로퍼티

the folder path for storing the temporary data generated by mpdf. If not set this defaults to Yii::getAlias('@runtime/mpdf').
public $tempPath