Property | Type | Description | |
---|---|---|---|
$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'). |
Property | Type | Description | |
---|---|---|---|
$_css | the css file content | ||
$_mpdf | api instance | ||
$_pdfAttachements | Array of file-pathes that should be attached to the generated PDF |
Method | Description | |
---|---|---|
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 |
Method | Description | |
---|---|---|
definePath ( string $prop, string $dir ) : boolean | Defines a mPDF temporary path if not set | |
parseFormat ( ) | Parse the format automatically based on the orientation |
Method | Description | |
---|---|---|
writePdfAttachement ( mPDF $api, String $attachement ) | appends the given attachement to the generated PDF |
public addPdfAttachement ( string $filePath ) | ||
$filePath | string |
public getApi ( ) : mPDF | ||
return | mPDF | instance |
public getPdfAttachements ( ) : array | ||
return | array | Array of attachements |
public initTempPaths ( ) |
protected parseFormat ( ) |
public render ( ) |
protected $_pdfAttachements |
public $defaultFont |
public $defaultFontSize |
public $marginBottom |
public $marginHeader |
public $marginLeft |
public $marginRight |
public $marginTop |
public $methods |
public $mode |
public $options |
public $orientation |