* Do not edit this file unless you're happy to maintain any changes yourself.
*/
+$dompdfPaperSizeMap = [
+ 'a4' => 'a4',
+ 'letter' => 'letter',
+];
+
return [
'show_warnings' => false, // Throw an Exception on warnings from dompdf
- 'orientation' => 'portrait',
- 'defines' => [
+
+ 'options' => [
/**
* The location of the DOMPDF font directory.
*
* Times-Roman, Times-Bold, Times-BoldItalic, Times-Italic,
* Symbol, ZapfDingbats.
*/
- 'DOMPDF_FONT_DIR' => storage_path('fonts/'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782)
+ 'font_dir' => storage_path('fonts/'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782)
/**
* The location of the DOMPDF font cache directory.
*
* Note: This directory must exist and be writable by the webserver process.
*/
- 'DOMPDF_FONT_CACHE' => storage_path('fonts/'),
+ 'font_cache' => storage_path('fonts/'),
/**
* The location of a temporary directory.
* The temporary directory is required to download remote images and when
* using the PFDLib back end.
*/
- 'DOMPDF_TEMP_DIR' => sys_get_temp_dir(),
+ 'temp_dir' => sys_get_temp_dir(),
/**
* ==== IMPORTANT ====.
* direct class use like:
* $dompdf = new DOMPDF(); $dompdf->load_html($htmldata); $dompdf->render(); $pdfdata = $dompdf->output();
*/
- 'DOMPDF_CHROOT' => realpath(base_path()),
+ '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
*/
- 'DOMPDF_UNICODE_ENABLED' => true,
+ 'allowed_protocols' => [
+ 'file://' => ['rules' => []],
+ 'http://' => ['rules' => []],
+ 'https://' => ['rules' => []],
+ ],
+
+ /**
+ * @var string
+ */
+ 'log_output_file' => null,
/**
* Whether to enable font subsetting or not.
*/
- 'DOMPDF_ENABLE_FONTSUBSETTING' => false,
+ 'enable_fontsubsetting' => false,
/**
* The PDF rendering backend to use.
* @link http://www.ros.co.nz/pdf
* @link http://www.php.net/image
*/
- 'DOMPDF_PDF_BACKEND' => 'CPDF',
+ 'pdf_backend' => 'CPDF',
/**
* PDFlib license key.
* the desired content might be different (e.g. screen or projection view of html file).
* Therefore allow specification of content here.
*/
- 'DOMPDF_DEFAULT_MEDIA_TYPE' => 'print',
+ 'default_media_type' => 'print',
/**
* The default paper size.
*
* @see CPDF_Adapter::PAPER_SIZES for valid sizes ('letter', 'legal', 'A4', etc.)
*/
- 'DOMPDF_DEFAULT_PAPER_SIZE' => 'a4',
+ '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.
*
* @var string
*/
- 'DOMPDF_DEFAULT_FONT' => 'dejavu sans',
+ 'default_font' => 'dejavu sans',
/**
* Image DPI setting.
*
* @var int
*/
- 'DOMPDF_DPI' => 96,
+ 'dpi' => 96,
/**
* Enable inline PHP.
*
* @var bool
*/
- 'DOMPDF_ENABLE_PHP' => false,
+ 'enable_php' => false,
/**
* Enable inline Javascript.
*
* @var bool
*/
- 'DOMPDF_ENABLE_JAVASCRIPT' => false,
+ 'enable_javascript' => false,
/**
* Enable remote file access.
*
* @var bool
*/
- 'DOMPDF_ENABLE_REMOTE' => true,
+ 'enable_remote' => env('ALLOW_UNTRUSTED_SERVER_FETCHING', false),
/**
* A ratio applied to the fonts height to be more like browsers' line height.
*/
- 'DOMPDF_FONT_HEIGHT_RATIO' => 1.1,
+ 'font_height_ratio' => 1.1,
/**
* Enable CSS float.
*
* @var bool
*/
- 'DOMPDF_ENABLE_CSS_FLOAT' => true,
+ '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
*/
- 'DOMPDF_ENABLE_HTML5PARSER' => true,
-
+ 'enable_html5_parser' => true,
],
];