Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/Config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@

// Third Party
'ImageTool' => Intervention\Image\Facades\Image::class,
'DomPDF' => Barryvdh\DomPDF\Facade::class,
'SnappyPDF' => Barryvdh\Snappy\Facades\SnappyPdf::class,

// Custom BookStack
'Activity' => BookStack\Facades\Activity::class,
Expand Down
43 changes: 32 additions & 11 deletions app/Config/dompdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
return [

'show_warnings' => false, // Throw an Exception on warnings from dompdf
'orientation' => 'portrait',
'defines' => [

'options' => [
/**
* The location of the DOMPDF font directory.
*
Expand Down Expand Up @@ -77,15 +77,25 @@
'chroot' => realpath(public_path()),

/**
* Whether to use Unicode fonts or not.
* Protocol whitelist
*
* When set to true the PDF backend must be set to "CPDF" and fonts must be
* loaded via load_font.php.
* Protocols and PHP wrappers allowed in URIs, and the validation rules
* that determine if a resouce may be loaded. Full support is not guaranteed
* for the protocols/wrappers specified
* by this array.
*
* When enabled, dompdf can support all Unicode glyphs. Any glyphs used in a
* document must be present in your fonts, however.
* @var array
*/
'unicode_enabled' => true,
'allowed_protocols' => [
"file://" => ["rules" => []],
"http://" => ["rules" => []],
"https://" => ["rules" => []]
],

/**
* @var string
*/
'log_output_file' => null,

/**
* Whether to enable font subsetting or not.
Expand Down Expand Up @@ -156,6 +166,15 @@
*/
'default_paper_size' => $dompdfPaperSizeMap[env('EXPORT_PAGE_SIZE', 'a4')] ?? 'a4',

/**
* The default paper orientation.
*
* The orientation of the page (portrait or landscape).
*
* @var string
*/
'default_paper_orientation' => "portrait",

/**
* The default font family.
*
Expand Down Expand Up @@ -258,10 +277,12 @@
'enable_css_float' => true,

/**
* Use the more-than-experimental HTML5 Lib parser.
* Use the HTML5 Lib parser
*
* @deprecated This feature is now always on in dompdf 2.x
* @var bool
*/
'enable_html5parser' => true,

"enable_html5_parser" => true,
],

];
2 changes: 1 addition & 1 deletion app/Entities/Tools/PdfGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace BookStack\Entities\Tools;

use Barryvdh\DomPDF\Facade as DomPDF;
use Barryvdh\DomPDF\Facade\Pdf as DomPDF;
use Barryvdh\Snappy\Facades\SnappyPdf;

class PdfGenerator
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"ext-mbstring": "*",
"ext-xml": "*",
"bacon/bacon-qr-code": "^2.0",
"barryvdh/laravel-dompdf": "^1.0",
"barryvdh/laravel-dompdf": "^2.0",
"barryvdh/laravel-snappy": "^1.0",
"doctrine/dbal": "^3.1",
"filp/whoops": "^2.14",
Expand Down
Loading