Recommend this page to a friend! |
Classes of Abed Nego Ragil Putra | PHP Inventory Management System with Scanner | vendor/barryvdh/laravel-dompdf/readme.md | Download |
|
DownloadDOMPDF Wrapper for Laravel 5For Laravel 4.x, check the 0.4 branch!Require this package in your composer.json and update composer. This will download the package and the dompdf + fontlib libraries also.
InstallationLaravel 5.x:After updating composer, add the ServiceProvider to the providers array in config/app.php
You can optionally use the facade for shorter code. Add this to your facades:
Lumen:After updating composer add the following lines to register provider in
To change the configuration, copy the config file to your config folder and enable it in
UsingYou can create a new DOMPDF instance and load a HTML string, file or view name. You can save it to a file, or stream (show in browser) or download.
Or use the facade:
You can chain the methods:
You can change the orientation and paper size, and hide or show errors (by default, errors are shown when debug is on)
If you need the output as a string, you can get the rendered PDF with the output() function, so you can save/output it yourself. Use ConfigurationThe defaults configuration settings are set in
You can still alter the dompdf options in your code before generating the pdf using this command:
Available options and their defaults: * __rootDir__: "{app_directory}/vendor/dompdf/dompdf" * __tempDir__: "/tmp" _(available in config/dompdf.php)_ * __fontDir__: "{app_directory}/storage/fonts/" _(available in config/dompdf.php)_ * __fontCache__: "{app_directory}/storage/fonts/" _(available in config/dompdf.php)_ * __chroot__: "{app_directory}" _(available in config/dompdf.php)_ * __logOutputFile__: "/tmp/log.htm" * __defaultMediaType__: "screen" _(available in config/dompdf.php)_ * __defaultPaperSize__: "a4" _(available in config/dompdf.php)_ * __defaultFont__: "serif" _(available in config/dompdf.php)_ * __dpi__: 96 _(available in config/dompdf.php)_ * __fontHeightRatio__: 1.1 _(available in config/dompdf.php)_ * __isPhpEnabled__: false _(available in config/dompdf.php)_ * __isRemoteEnabled__: true _(available in config/dompdf.php)_ * __isJavascriptEnabled__: true _(available in config/dompdf.php)_ * __isHtml5ParserEnabled__: false _(available in config/dompdf.php)_ * __isFontSubsettingEnabled__: false _(available in config/dompdf.php)_ * __debugPng__: false * __debugKeepTemp__: false * __debugCss__: false * __debugLayout__: false * __debugLayoutLines__: true * __debugLayoutBlocks__: true * __debugLayoutInline__: true * __debugLayoutPaddingBox__: true * __pdfBackend__: "CPDF" _(available in config/dompdf.php)_ * __pdflibLicense__: "" * __adminUsername__: "user" * __adminPassword__: "password" Tip: UTF-8 supportIn your templates, set the UTF-8 Metatag:
Tip: Page breaksYou can use the CSS
LicenseThis DOMPDF Wrapper for Laravel is open-sourced software licensed under the MIT license |