PHP Class Barryvdh\DomPDF\PDF

Author: Barry vd. Heuvel
Datei anzeigen Open project: barryvdh/laravel-dompdf Class Usage Examples

Protected Properties

Property Type Description
$config Illuminate\Contracts\Config\Repository
$dompdf Dompdf\Dompdf
$files Illuminate\Filesystem\Filesystem
$orientation
$paper
$public_path
$rendered
$showWarnings
$view Illuminate\Contracts\View\Factory

Public Methods

Method Description
__construct ( Dompdf\Dompdf $dompdf, Illuminate\Contracts\Config\Repository $config, Illuminate\Filesystem\Filesystem $files, Illuminate\Contracts\View\Factory $view )
download ( string $filename = 'document.pdf' ) : Illuminate\Http\Response Make the PDF downloadable by the user
getDomPDF ( ) : Dompdf\Dompdf Get the DomPDF instance
loadFile ( string $file ) : static Load a HTML file
loadHTML ( string $string, string $encoding = null ) : static Load a HTML string
loadView ( string $view, array $data = [], array $mergeData = [], string $encoding = null ) : static Load a View and convert to HTML
output ( ) : string Output the PDF as a string.
save ( $filename ) : static Save the PDF to a file
setOptions ( array $options ) : static Set/Change an option in DomPdf
setPaper ( string $paper, string $orientation = 'portrait' ) Set the paper size (default A4)
setWarnings ( boolean $warnings ) Show or hide warnings
stream ( string $filename = 'document.pdf' ) : Illuminate\Http\Response Return a response with the PDF to show in the browser

Protected Methods

Method Description
convertEntities ( $subject )
render ( ) Render the PDF

Method Details

__construct() public method

public __construct ( Dompdf\Dompdf $dompdf, Illuminate\Contracts\Config\Repository $config, Illuminate\Filesystem\Filesystem $files, Illuminate\Contracts\View\Factory $view )
$dompdf Dompdf\Dompdf
$config Illuminate\Contracts\Config\Repository
$files Illuminate\Filesystem\Filesystem
$view Illuminate\Contracts\View\Factory

convertEntities() protected method

protected convertEntities ( $subject )

download() public method

Make the PDF downloadable by the user
public download ( string $filename = 'document.pdf' ) : Illuminate\Http\Response
$filename string
return Illuminate\Http\Response

getDomPDF() public method

Get the DomPDF instance
public getDomPDF ( ) : Dompdf\Dompdf
return Dompdf\Dompdf

loadFile() public method

Load a HTML file
public loadFile ( string $file ) : static
$file string
return static

loadHTML() public method

Load a HTML string
public loadHTML ( string $string, string $encoding = null ) : static
$string string
$encoding string Not used yet
return static

loadView() public method

Load a View and convert to HTML
public loadView ( string $view, array $data = [], array $mergeData = [], string $encoding = null ) : static
$view string
$data array
$mergeData array
$encoding string Not used yet
return static

output() public method

Output the PDF as a string.
public output ( ) : string
return string The rendered PDF as string

render() protected method

Render the PDF
protected render ( )

save() public method

Save the PDF to a file
public save ( $filename ) : static
$filename
return static

setOptions() public method

Set/Change an option in DomPdf
public setOptions ( array $options ) : static
$options array
return static

setPaper() public method

Set the paper size (default A4)
public setPaper ( string $paper, string $orientation = 'portrait' )
$paper string
$orientation string

setWarnings() public method

Show or hide warnings
public setWarnings ( boolean $warnings )
$warnings boolean

stream() public method

Return a response with the PDF to show in the browser
public stream ( string $filename = 'document.pdf' ) : Illuminate\Http\Response
$filename string
return Illuminate\Http\Response

Property Details

$config protected_oe property

protected Repository,Illuminate\Contracts\Config $config
return Illuminate\Contracts\Config\Repository

$dompdf protected_oe property

protected Dompdf,Dompdf $dompdf
return Dompdf\Dompdf

$files protected_oe property

protected Filesystem,Illuminate\Filesystem $files
return Illuminate\Filesystem\Filesystem

$orientation protected_oe property

protected $orientation

$paper protected_oe property

protected $paper

$public_path protected_oe property

protected $public_path

$rendered protected_oe property

protected $rendered

$showWarnings protected_oe property

protected $showWarnings

$view protected_oe property

protected Factory,Illuminate\Contracts\View $view
return Illuminate\Contracts\View\Factory