PHP Class Barryvdh\Snappy\PdfWrapper

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

Protected Properties

Property Type Description
$options array
$snappy Knp\Snappy\Pdf

Public Methods

Method Description
__call ( string $name, array $arguments ) : mixed Call Snappy instance.
__construct ( Knp\Snappy\Pdf $snappy )
download ( string $filename = 'document.pdf' ) : Illuminate\Http\Response Make the PDF downloadable by the user
inline ( string $filename = 'document.pdf' ) : Illuminate\Http\Response Return a response with the PDF to show in the browser
loadFile ( string $file ) Load a HTML file
loadHTML ( string $string ) Load a HTML string
loadView ( string $view, array $data = [], array $mergeData = [] ) Load a View and convert to HTML
output ( ) : string Output the PDF as a string.
save ( $filename, $overwrite = false ) Save the PDF to a file
setOption ( string $name, mixed $value )
setOptions ( array $options )
setOrientation ( string $orientation ) Set the orientation (default portrait)
setPaper ( string $paper, string $orientation = null ) Set the paper size (default A4)
setWarnings ( boolean $warnings ) Show or hide warnings
snappy ( ) : Knp\Snappy\Pdf Get the Snappy instance.
stream ( string $filename = 'document.pdf' ) : Symfony\Component\HttpFoundation\StreamedResponse Return a response with the PDF to show in the browser

Method Details

__call() public method

Also shortcut's ->html => loadHtml ->view => loadView ->file => loadFile
public __call ( string $name, array $arguments ) : mixed
$name string
$arguments array
return mixed

__construct() public method

public __construct ( Knp\Snappy\Pdf $snappy )
$snappy Knp\Snappy\Pdf

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

inline() public method

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

loadFile() public method

Load a HTML file
public loadFile ( string $file )
$file string

loadHTML() public method

Load a HTML string
public loadHTML ( string $string )
$string string

loadView() public method

Load a View and convert to HTML
public loadView ( string $view, array $data = [], array $mergeData = [] )
$view string
$data array
$mergeData array

output() public method

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

save() public method

Save the PDF to a file
public save ( $filename, $overwrite = false )
$filename

setOption() public method

public setOption ( string $name, mixed $value )
$name string
$value mixed

setOptions() public method

public setOptions ( array $options )
$options array

setOrientation() public method

Set the orientation (default portrait)
public setOrientation ( string $orientation )
$orientation string

setPaper() public method

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

setWarnings() public method

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

snappy() public method

Get the Snappy instance.
public snappy ( ) : Knp\Snappy\Pdf
return Knp\Snappy\Pdf

stream() public method

Return a response with the PDF to show in the browser
Deprecation: use inline() instead
public stream ( string $filename = 'document.pdf' ) : Symfony\Component\HttpFoundation\StreamedResponse
$filename string
return Symfony\Component\HttpFoundation\StreamedResponse

Property Details

$options protected_oe property

protected array $options
return array

$snappy protected_oe property

protected Pdf,Knp\Snappy $snappy
return Knp\Snappy\Pdf