Pdf.php
2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
namespace Barryvdh\DomPDF\Facade;
use Barryvdh\DomPDF\PDF as BasePDF;
use Illuminate\Support\Facades\Facade as IlluminateFacade;
use RuntimeException;
/**
* @method static BasePDF setBaseHost(string $baseHost)
* @method static BasePDF setBasePath(string $basePath)
* @method static BasePDF setCanvas(\Dompdf\Canvas $canvas)
* @method static BasePDF setCallbacks(array $callbacks)
* @method static BasePDF setCss(\Dompdf\Css\Stylesheet $css)
* @method static BasePDF setDefaultView(string $defaultView, array $options)
* @method static BasePDF setDom(\DOMDocument $dom)
* @method static BasePDF setFontMetrics(\Dompdf\FontMetrics $fontMetrics)
* @method static BasePDF setHttpContext(resource|array $httpContext)
* @method static BasePDF setPaper(string|float[] $paper, string $orientation = 'portrait')
* @method static BasePDF setProtocol(string $protocol)
* @method static BasePDF setTree(\Dompdf\Frame\FrameTree $tree)
* @method static BasePDF setWarnings(bool $warnings)
* @method static BasePDF setOption(array|string $attribute, $value = null)
* @method static BasePDF setOptions(array $options)
* @method static BasePDF loadView(string $view, array $data = [], array $mergeData = [], ?string $encoding = null)
* @method static BasePDF loadHTML(string $string, ?string $encoding = null)
* @method static BasePDF loadFile(string $file)
* @method static BasePDF addInfo(array $info)
* @method static string output(array $options = [])
* @method static BasePDF save()
* @method static \Illuminate\Http\Response download(string $filename = 'document.pdf')
* @method static \Illuminate\Http\Response stream(string $filename = 'document.pdf')
*/
class Pdf extends IlluminateFacade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return 'dompdf.wrapper';
}
/**
* Handle dynamic, static calls to the object.
*
* @param string $method
* @param array<mixed> $args
* @return mixed
*
* @throws \RuntimeException
*/
public static function __callStatic($method, $args)
{
/** @var \Illuminate\Contracts\Foundation\Application|null */
$app = static::getFacadeApplication();
if (! $app) {
throw new RuntimeException('Facade application has not been set.');
}
// Resolve a new instance, avoid using a cached instance
$instance = $app->make(static::getFacadeAccessor());
return $instance->$method(...$args);
}
}