class PDF extends Renderer
Constants
DEFAULT_CREATOR |
|
DEFAULT_MARGIN |
|
UNIT_PX |
|
UNIT_IN |
|
UNIT_CM |
|
UNIT_MM |
|
FORMAT_A0 |
|
FORMAT_A1 |
|
FORMAT_A2 |
|
FORMAT_A3 |
|
FORMAT_A4 |
|
FORMAT_A5 |
|
FORMAT_A6 |
|
FORMAT_LETTER |
|
FORMAT_LEGAL |
|
FORMAT_TABLOID |
|
FORMAT_LEDGER |
|
Properties
protected string | $format | ||
protected string | $extension | from Renderer | |
protected array | $options | from Renderer | |
protected array | $tags |
Methods
No description
Sets the devicePixelRatio of the viewport
Waits until the entire document, including resources are fully loaded.
Waits until the 'DOMContentLoaded' event is fired.
Waits until there has not been any network requests for at least 500ms
Waits until there has not been more than 2 network requests for at least 500ms
Maximum amount of time to wait before timing out in milliseconds. Defaults to 30000
Retrieve the rendered content as a download response
Retrieve the rendered content as a response
Postprocessing stage
Render from a view
Render from named route.
Gets the application version string
Enable the display of header and footer
Sets the HTML template for the print header.
Sets the HTML template for the print header from a blade view
Sets the HTML template for the print footer.
Sets the HTML template for the print footer from a blade view
Paper ranges to print, e.g., [1, 5], 8, [11, 13]
Print background graphics. Defaults to false
Paper right margin
Paper bottom margin
Paper left margin
Paper format. If set, takes priority over width or height options. Defaults to 'A4'
Appends the given unit to value if the unit is valid
Sets the media emulation. Defaults to NULL
Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
Get a list of supported units
Get a list of supported paper formats
Gets a PDF meta tag value
Sets the PDF description meta
Sets the PDF keywords meta
Sets the PDF application meta
Details
at line 80
protected
__construct(string $url, array $options = [])
in
Renderer at line 62
protected ResponseInterface
fetch()
in
Renderer at line 108
protected
getOption(string $key, $default = null)
in
Renderer at line 123
Renderer
devicePixelRatio(float $pixelRatio = 1.0)
Sets the devicePixelRatio of the viewport
in
Renderer at line 133
Renderer
waitUntilLoaded()
Waits until the entire document, including resources are fully loaded.
in
Renderer at line 143
Renderer
waitUntiDOMContentLoaded()
Waits until the 'DOMContentLoaded' event is fired.
in
Renderer at line 153
Renderer
waitUntiNetworkIdle()
Waits until there has not been any network requests for at least 500ms
in
Renderer at line 163
Renderer
waitUntiNetworkSettled()
Waits until there has not been more than 2 network requests for at least 500ms
in
Renderer at line 174
Renderer
timeout(int $timeout)
Maximum amount of time to wait before timing out in milliseconds. Defaults to 30000
in
Renderer at line 184
resource
stream()
Get the rendered content as a file handle (resource)
in
Renderer at line 197
string|null
blob()
Get the rendered content as a blob
in
Renderer at line 212
Response
download(string $filename = null)
Retrieve the rendered content as a download response
in
Renderer at line 237
Response
toResponse(Request $request = null)
Retrieve the rendered content as a response
in
Renderer at line 260
string
link()
Retrieve URL to the rendered content
at line 597
protected ResponseInterface
postProcess(ResponseInterface $response)
Postprocessing stage
in
Renderer at line 319
static Renderer
view(View|string $view, Arrayable|array $data = [], array $mergeData = [])
Render from a view
in
Renderer at line 336
static Renderer
route(array|string $name = null, mixed $parameters = [], bool $absolute = true)
Render from named route.
in
Renderer at line 344
array
__debugInfo()
in
Renderer at line 352
string
__toString()
in
Renderer at line 360
string
jsonSerialize()
in
Renderer at line 369
string
toJson(int $options = 0)
at line 94
final protected string
getVersion()
Gets the application version string
at line 107
PDF
displayHeaderFooter(bool $displayHeaderFooter = true)
Enable the display of header and footer
at line 118
PDF
headerTemplateFrom(HtmlString|string $template)
Sets the HTML template for the print header.
at line 137
PDF
headerTemplate(View|string $view, Arrayable|array $data = [], array $mergeData = [])
Sets the HTML template for the print header from a blade view
at line 154
PDF
footerTemplateFrom(HtmlString|string $template)
Sets the HTML template for the print footer.
at line 173
PDF
footerTemplate(View|string $view, Arrayable|array $data = [], array $mergeData = [])
Sets the HTML template for the print footer from a blade view
at line 190
PDF
pageRanges(array|int ...$ranges)
Paper ranges to print, e.g., [1, 5], 8, [11, 13]
at line 212
PDF
printBackground(bool $printBackground = true)
Print background graphics. Defaults to false
at line 224
PDF
marginTop(int|string $marginTop, string $unit = PDF::UNIT_CM)
Paper top margin
at line 238
PDF
marginRight(int|string $marginRight, string $unit = PDF::UNIT_CM)
Paper right margin
at line 252
PDF
marginBottom(int|string $marginBottom, string $unit = PDF::UNIT_CM)
Paper bottom margin
at line 266
PDF
marginLeft(int|string $marginLeft, string $unit = PDF::UNIT_CM)
Paper left margin
at line 279
PDF
margin(int|string ...$values)
Paper margins
at line 312
PDF
format(string $format = PDF::FORMAT_A4)
Paper format. If set, takes priority over width or height options. Defaults to 'A4'
at line 333
static protected int|string
appendUnit(int|string $value, string|null $unit = null)
Appends the given unit to value if the unit is valid
at line 356
PDF
emulatedMedia(string|null $media = null)
Sets the media emulation. Defaults to NULL
at line 371
PDF
width(int $width)
Paper width
at line 390
PDF
height(int $height)
Paper height
at line 409
PDF
preferCSSPageSize(bool $preferCSSPageSize = true)
Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
at line 420
PDF
landscape(bool $landscape = true)
Paper orientation
at line 431
PDF
scale(float $scale = 1.0)
Sets the document scaling factor
at line 441
static string[]
units()
Get a list of supported units
at line 456
static string[]
formats()
Get a list of supported paper formats
at line 480
protected PDF
setTag(string $tag, string|null $value)
Sets a PDF meta tag
at line 493
protected string|null
getTag(string $tag, string|null $default = null)
Gets a PDF meta tag value
at line 504
PDF
author(string $author)
Sets the PDF author meta
at line 515
PDF
description(string $description)
Sets the PDF description meta
at line 526
void
keywords(array $keywords)
Sets the PDF keywords meta
at line 537
PDF
keyword(string $keyword)
Adds a PDF meta keyword
at line 551
PDF
creator(string $creator)
Sets the PDF content creator meta
at line 562
PDF
application(string $application)
Sets the PDF application meta