PDFWrapper
extends PDF
in package
A Laravel wrapper for Dompdf
Table of Contents
- $config : Repository
- $dompdf : Dompdf
- $files : Filesystem
- $public_path : mixed
- $rendered : mixed
- $showWarnings : mixed
- $view : Factory
- __call() : mixed
- __construct() : mixed
- addInfo() : static
- Add metadata info
- download() : Response
- Make the PDF downloadable by the user
- getDomPDF() : Dompdf
- Get the DomPDF instance
- loadFile() : static
- Load a HTML file
- loadHTML() : static
- Load a HTML string
- loadLayout() : mixed
- loadTemplate() : mixed
- loadView() : static
- Load a View and convert to HTML
- output() : string
- Output the PDF as a string.
- parseLayout() : mixed
- parseTemplate() : mixed
- save() : static
- Save the PDF to a file
- setEncryption() : mixed
- setOptions() : static
- Set/Change an option in DomPdf
- setPaper() : $this
- Set the paper size (default A4)
- setWarnings() : $this
- Show or hide warnings
- stream() : Response
- Return a response with the PDF to show in the browser
- convertEntities() : mixed
- layoutData() : mixed
- parseMarkup() : mixed
- render() : mixed
- Render the PDF
- setLocale() : mixed
Properties
$config
protected
Repository
$config
$dompdf
protected
Dompdf
$dompdf
$files
protected
Filesystem
$files
$public_path
protected
mixed
$public_path
$rendered
protected
mixed
$rendered
= false
$showWarnings
protected
mixed
$showWarnings
$view
protected
Factory
$view
Methods
__call()
public
__call(mixed $method, mixed $args) : mixed
Parameters
- $method : mixed
- $args : mixed
Return values
mixed —__construct()
public
__construct(Dompdf $dompdf, Repository $config, Filesystem $files, Factory $view) : mixed
Parameters
- $dompdf : Dompdf
- $config : Repository
- $files : Filesystem
- $view : Factory
Return values
mixed —addInfo()
Add metadata info
public
addInfo(array<string|int, mixed> $info) : static
Parameters
- $info : array<string|int, mixed>
Return values
static —download()
Make the PDF downloadable by the user
public
download([string $filename = 'document.pdf' ]) : Response
Parameters
- $filename : string = 'document.pdf'
Return values
Response —getDomPDF()
Get the DomPDF instance
public
getDomPDF() : Dompdf
Return values
Dompdf —loadFile()
Load a HTML file
public
loadFile(string $file) : static
Parameters
- $file : string
Return values
static —loadHTML()
Load a HTML string
public
loadHTML(string $string[, string $encoding = null ]) : static
Parameters
- $string : string
- $encoding : string = null
-
Not used yet
Return values
static —loadLayout()
public
loadLayout(mixed $code[, mixed $data = [] ][, mixed $encoding = null ]) : mixed
Parameters
- $code : mixed
- $data : mixed = []
- $encoding : mixed = null
Return values
mixed —loadTemplate()
public
loadTemplate(mixed $code[, mixed $data = [] ][, mixed $encoding = null ]) : mixed
Parameters
- $code : mixed
- $data : mixed = []
- $encoding : mixed = null
Return values
mixed —loadView()
Load a View and convert to HTML
public
loadView(string $view[, array<string|int, mixed> $data = array() ][, array<string|int, mixed> $mergeData = array() ][, string $encoding = null ]) : static
Parameters
- $view : string
- $data : array<string|int, mixed> = array()
- $mergeData : array<string|int, mixed> = array()
- $encoding : string = null
-
Not used yet
Return values
static —output()
Output the PDF as a string.
public
output() : string
Return values
string —The rendered PDF as string
parseLayout()
public
parseLayout(mixed $layout[, mixed $data = [] ]) : mixed
Parameters
- $layout : mixed
- $data : mixed = []
Return values
mixed —parseTemplate()
public
parseTemplate(mixed $template[, mixed $data = [] ]) : mixed
Parameters
- $template : mixed
- $data : mixed = []
Return values
mixed —save()
Save the PDF to a file
public
save( $filename) : static
Parameters
Return values
static —setEncryption()
public
setEncryption(mixed $password) : mixed
Parameters
- $password : mixed
Return values
mixed —setOptions()
Set/Change an option in DomPdf
public
setOptions(array<string|int, mixed> $options) : static
Parameters
- $options : array<string|int, mixed>
Return values
static —setPaper()
Set the paper size (default A4)
public
setPaper(string $paper[, string $orientation = 'portrait' ]) : $this
Parameters
- $paper : string
- $orientation : string = 'portrait'
Return values
$this —setWarnings()
Show or hide warnings
public
setWarnings(bool $warnings) : $this
Parameters
- $warnings : bool
Return values
$this —stream()
Return a response with the PDF to show in the browser
public
stream([string $filename = 'document.pdf' ]) : Response
Parameters
- $filename : string = 'document.pdf'
Return values
Response —convertEntities()
protected
convertEntities(mixed $subject) : mixed
Parameters
- $subject : mixed
Return values
mixed —layoutData()
protected
layoutData(mixed $layout, mixed $data) : mixed
Parameters
- $layout : mixed
- $data : mixed
Return values
mixed —parseMarkup()
protected
parseMarkup(mixed $markup, mixed $data) : mixed
Parameters
- $markup : mixed
- $data : mixed
Return values
mixed —render()
Render the PDF
protected
render() : mixed
Return values
mixed —setLocale()
protected
setLocale() : mixed