Skip to content

Commit 07d6979

Browse files
author
Hans VN
committed
update readme for dompdf setoptions function
1 parent 4f4c1e8 commit 07d6979

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

readme.md

+39
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,45 @@ If you need the output as a string, you can get the rendered PDF with the output
5858
Use `php artisan vendor:publish` to create a config file located at `config/dompdf.php` which will allow you to define local configurations to change some settings (default paper etc).
5959
You can also use your ConfigProvider to set certain keys.
6060

61+
### Configuration
62+
The defaults configuration settings are set in `config/dompdf.php`. Copy this file to your own config directory to modify the values. You can publish the config using this command:
63+
64+
php artisan vendor:publish --provider="Barryvdh\DomPDF\ServiceProvider"
65+
66+
You can still alter the dompdf options in your code before generating the pdf using this command:
67+
68+
PDF::setOptions(['dpi' => 150, 'defaultFont' => 'sans-serif']);
69+
70+
Available options and their defaults:
71+
* __rootDir__: "{app_directory}/vendor/dompdf/dompdf"
72+
* __tempDir__: "/tmp" _(available in config/dompdf.php)_
73+
* __fontDir__: "{app_directory}/storage/fonts/" _(available in config/dompdf.php)_
74+
* __fontCache__: "{app_directory}/storage/fonts/" _(available in config/dompdf.php)_
75+
* __chroot__: "{app_directory}" _(available in config/dompdf.php)_
76+
* __logOutputFile__: "/tmp/log.htm"
77+
* __defaultMediaType__: "screen" _(available in config/dompdf.php)_
78+
* __defaultPaperSize__: "a4" _(available in config/dompdf.php)_
79+
* __defaultFont__: "serif" _(available in config/dompdf.php)_
80+
* __dpi__: 96 _(available in config/dompdf.php)_
81+
* __fontHeightRatio__: 1.1 _(available in config/dompdf.php)_
82+
* __isPhpEnabled__: false _(available in config/dompdf.php)_
83+
* __isRemoteEnabled__: true _(available in config/dompdf.php)_
84+
* __isJavascriptEnabled__: true _(available in config/dompdf.php)_
85+
* __isHtml5ParserEnabled__: false _(available in config/dompdf.php)_
86+
* __isFontSubsettingEnabled__: false _(available in config/dompdf.php)_
87+
* __debugPng__: false
88+
* __debugKeepTemp__: false
89+
* __debugCss__: false
90+
* __debugLayout__: false
91+
* __debugLayoutLines__: true
92+
* __debugLayoutBlocks__: true
93+
* __debugLayoutInline__: true
94+
* __debugLayoutPaddingBox__: true
95+
* __pdfBackend__: "CPDF" _(available in config/dompdf.php)_
96+
* __pdflibLicense__: ""
97+
* __adminUsername__: "user"
98+
* __adminPassword__: "password"
99+
61100
### Tip: UTF-8 support
62101
In your templates, set the UTF-8 Metatag:
63102

0 commit comments

Comments
 (0)