|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+<?php
|
|
|
2
|
+
|
|
|
3
|
+return array(
|
|
|
4
|
+
|
|
|
5
|
+ /*
|
|
|
6
|
+ |--------------------------------------------------------------------------
|
|
|
7
|
+ | Settings
|
|
|
8
|
+ |--------------------------------------------------------------------------
|
|
|
9
|
+ |
|
|
|
10
|
+ | Set some default values. It is possible to add all defines that can be set
|
|
|
11
|
+ | in dompdf_config.inc.php. You can also override the entire config file.
|
|
|
12
|
+ |
|
|
|
13
|
+ */
|
|
|
14
|
+ 'show_warnings' => false, // Throw an Exception on warnings from dompdf
|
|
|
15
|
+
|
|
|
16
|
+ 'public_path' => null, // Override the public path if needed
|
|
|
17
|
+
|
|
|
18
|
+ /*
|
|
|
19
|
+ * Dejavu Sans font is missing glyphs for converted entities, turn it off if you need to show € and £.
|
|
|
20
|
+ */
|
|
|
21
|
+ 'convert_entities' => true,
|
|
|
22
|
+
|
|
|
23
|
+ 'options' => array(
|
|
|
24
|
+ /**
|
|
|
25
|
+ * The location of the DOMPDF font directory
|
|
|
26
|
+ *
|
|
|
27
|
+ * The location of the directory where DOMPDF will store fonts and font metrics
|
|
|
28
|
+ * Note: This directory must exist and be writable by the webserver process.
|
|
|
29
|
+ * *Please note the trailing slash.*
|
|
|
30
|
+ *
|
|
|
31
|
+ * Notes regarding fonts:
|
|
|
32
|
+ * Additional .afm font metrics can be added by executing load_font.php from command line.
|
|
|
33
|
+ *
|
|
|
34
|
+ * Only the original "Base 14 fonts" are present on all pdf viewers. Additional fonts must
|
|
|
35
|
+ * be embedded in the pdf file or the PDF may not display correctly. This can significantly
|
|
|
36
|
+ * increase file size unless font subsetting is enabled. Before embedding a font please
|
|
|
37
|
+ * review your rights under the font license.
|
|
|
38
|
+ *
|
|
|
39
|
+ * Any font specification in the source HTML is translated to the closest font available
|
|
|
40
|
+ * in the font directory.
|
|
|
41
|
+ *
|
|
|
42
|
+ * The pdf standard "Base 14 fonts" are:
|
|
|
43
|
+ * Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique,
|
|
|
44
|
+ * Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique,
|
|
|
45
|
+ * Times-Roman, Times-Bold, Times-BoldItalic, Times-Italic,
|
|
|
46
|
+ * Symbol, ZapfDingbats.
|
|
|
47
|
+ */
|
|
|
48
|
+ "font_dir" => storage_path('fonts'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782)
|
|
|
49
|
+
|
|
|
50
|
+ /**
|
|
|
51
|
+ * The location of the DOMPDF font cache directory
|
|
|
52
|
+ *
|
|
|
53
|
+ * This directory contains the cached font metrics for the fonts used by DOMPDF.
|
|
|
54
|
+ * This directory can be the same as DOMPDF_FONT_DIR
|
|
|
55
|
+ *
|
|
|
56
|
+ * Note: This directory must exist and be writable by the webserver process.
|
|
|
57
|
+ */
|
|
|
58
|
+ "font_cache" => storage_path('fonts'),
|
|
|
59
|
+
|
|
|
60
|
+ /**
|
|
|
61
|
+ * The location of a temporary directory.
|
|
|
62
|
+ *
|
|
|
63
|
+ * The directory specified must be writeable by the webserver process.
|
|
|
64
|
+ * The temporary directory is required to download remote images and when
|
|
|
65
|
+ * using the PFDLib back end.
|
|
|
66
|
+ */
|
|
|
67
|
+ "temp_dir" => sys_get_temp_dir(),
|
|
|
68
|
+
|
|
|
69
|
+ /**
|
|
|
70
|
+ * ==== IMPORTANT ====
|
|
|
71
|
+ *
|
|
|
72
|
+ * dompdf's "chroot": Prevents dompdf from accessing system files or other
|
|
|
73
|
+ * files on the webserver. All local files opened by dompdf must be in a
|
|
|
74
|
+ * subdirectory of this directory. DO NOT set it to '/' since this could
|
|
|
75
|
+ * allow an attacker to use dompdf to read any files on the server. This
|
|
|
76
|
+ * should be an absolute path.
|
|
|
77
|
+ * This is only checked on command line call by dompdf.php, but not by
|
|
|
78
|
+ * direct class use like:
|
|
|
79
|
+ * $dompdf = new DOMPDF(); $dompdf->load_html($htmldata); $dompdf->render(); $pdfdata = $dompdf->output();
|
|
|
80
|
+ */
|
|
|
81
|
+ "chroot" => realpath(base_path()),
|
|
|
82
|
+
|
|
|
83
|
+ /**
|
|
|
84
|
+ * Protocol whitelist
|
|
|
85
|
+ *
|
|
|
86
|
+ * Protocols and PHP wrappers allowed in URIs, and the validation rules
|
|
|
87
|
+ * that determine if a resouce may be loaded. Full support is not guaranteed
|
|
|
88
|
+ * for the protocols/wrappers specified
|
|
|
89
|
+ * by this array.
|
|
|
90
|
+ *
|
|
|
91
|
+ * @var array
|
|
|
92
|
+ */
|
|
|
93
|
+ 'allowed_protocols' => [
|
|
|
94
|
+ "file://" => ["rules" => []],
|
|
|
95
|
+ "http://" => ["rules" => []],
|
|
|
96
|
+ "https://" => ["rules" => []]
|
|
|
97
|
+ ],
|
|
|
98
|
+
|
|
|
99
|
+ /**
|
|
|
100
|
+ * @var string
|
|
|
101
|
+ */
|
|
|
102
|
+ 'log_output_file' => null,
|
|
|
103
|
+
|
|
|
104
|
+ /**
|
|
|
105
|
+ * Whether to enable font subsetting or not.
|
|
|
106
|
+ */
|
|
|
107
|
+ "enable_font_subsetting" => false,
|
|
|
108
|
+
|
|
|
109
|
+ /**
|
|
|
110
|
+ * The PDF rendering backend to use
|
|
|
111
|
+ *
|
|
|
112
|
+ * Valid settings are 'PDFLib', 'CPDF' (the bundled R&OS PDF class), 'GD' and
|
|
|
113
|
+ * 'auto'. 'auto' will look for PDFLib and use it if found, or if not it will
|
|
|
114
|
+ * fall back on CPDF. 'GD' renders PDFs to graphic files. {@link
|
|
|
115
|
+ * Canvas_Factory} ultimately determines which rendering class to instantiate
|
|
|
116
|
+ * based on this setting.
|
|
|
117
|
+ *
|
|
|
118
|
+ * Both PDFLib & CPDF rendering backends provide sufficient rendering
|
|
|
119
|
+ * capabilities for dompdf, however additional features (e.g. object,
|
|
|
120
|
+ * image and font support, etc.) differ between backends. Please see
|
|
|
121
|
+ * {@link PDFLib_Adapter} for more information on the PDFLib backend
|
|
|
122
|
+ * and {@link CPDF_Adapter} and lib/class.pdf.php for more information
|
|
|
123
|
+ * on CPDF. Also see the documentation for each backend at the links
|
|
|
124
|
+ * below.
|
|
|
125
|
+ *
|
|
|
126
|
+ * The GD rendering backend is a little different than PDFLib and
|
|
|
127
|
+ * CPDF. Several features of CPDF and PDFLib are not supported or do
|
|
|
128
|
+ * not make any sense when creating image files. For example,
|
|
|
129
|
+ * multiple pages are not supported, nor are PDF 'objects'. Have a
|
|
|
130
|
+ * look at {@link GD_Adapter} for more information. GD support is
|
|
|
131
|
+ * experimental, so use it at your own risk.
|
|
|
132
|
+ *
|
|
|
133
|
+ * @link http://www.pdflib.com
|
|
|
134
|
+ * @link http://www.ros.co.nz/pdf
|
|
|
135
|
+ * @link http://www.php.net/image
|
|
|
136
|
+ */
|
|
|
137
|
+ "pdf_backend" => "CPDF",
|
|
|
138
|
+
|
|
|
139
|
+ /**
|
|
|
140
|
+ * PDFlib license key
|
|
|
141
|
+ *
|
|
|
142
|
+ * If you are using a licensed, commercial version of PDFlib, specify
|
|
|
143
|
+ * your license key here. If you are using PDFlib-Lite or are evaluating
|
|
|
144
|
+ * the commercial version of PDFlib, comment out this setting.
|
|
|
145
|
+ *
|
|
|
146
|
+ * @link http://www.pdflib.com
|
|
|
147
|
+ *
|
|
|
148
|
+ * If pdflib present in web server and auto or selected explicitely above,
|
|
|
149
|
+ * a real license code must exist!
|
|
|
150
|
+ */
|
|
|
151
|
+ //"DOMPDF_PDFLIB_LICENSE" => "your license key here",
|
|
|
152
|
+
|
|
|
153
|
+ /**
|
|
|
154
|
+ * html target media view which should be rendered into pdf.
|
|
|
155
|
+ * List of types and parsing rules for future extensions:
|
|
|
156
|
+ * http://www.w3.org/TR/REC-html40/types.html
|
|
|
157
|
+ * screen, tty, tv, projection, handheld, print, braille, aural, all
|
|
|
158
|
+ * Note: aural is deprecated in CSS 2.1 because it is replaced by speech in CSS 3.
|
|
|
159
|
+ * Note, even though the generated pdf file is intended for print output,
|
|
|
160
|
+ * the desired content might be different (e.g. screen or projection view of html file).
|
|
|
161
|
+ * Therefore allow specification of content here.
|
|
|
162
|
+ */
|
|
|
163
|
+ "default_media_type" => "screen",
|
|
|
164
|
+
|
|
|
165
|
+ /**
|
|
|
166
|
+ * The default paper size.
|
|
|
167
|
+ *
|
|
|
168
|
+ * North America standard is "letter"; other countries generally "a4"
|
|
|
169
|
+ *
|
|
|
170
|
+ * @see CPDF_Adapter::PAPER_SIZES for valid sizes ('letter', 'legal', 'A4', etc.)
|
|
|
171
|
+ */
|
|
|
172
|
+ "default_paper_size" => "a4",
|
|
|
173
|
+
|
|
|
174
|
+ /**
|
|
|
175
|
+ * The default paper orientation.
|
|
|
176
|
+ *
|
|
|
177
|
+ * The orientation of the page (portrait or landscape).
|
|
|
178
|
+ *
|
|
|
179
|
+ * @var string
|
|
|
180
|
+ */
|
|
|
181
|
+ 'default_paper_orientation' => "portrait",
|
|
|
182
|
+
|
|
|
183
|
+ /**
|
|
|
184
|
+ * The default font family
|
|
|
185
|
+ *
|
|
|
186
|
+ * Used if no suitable fonts can be found. This must exist in the font folder.
|
|
|
187
|
+ * @var string
|
|
|
188
|
+ */
|
|
|
189
|
+ "default_font" => "serif",
|
|
|
190
|
+
|
|
|
191
|
+ /**
|
|
|
192
|
+ * Image DPI setting
|
|
|
193
|
+ *
|
|
|
194
|
+ * This setting determines the default DPI setting for images and fonts. The
|
|
|
195
|
+ * DPI may be overridden for inline images by explictly setting the
|
|
|
196
|
+ * image's width & height style attributes (i.e. if the image's native
|
|
|
197
|
+ * width is 600 pixels and you specify the image's width as 72 points,
|
|
|
198
|
+ * the image will have a DPI of 600 in the rendered PDF. The DPI of
|
|
|
199
|
+ * background images can not be overridden and is controlled entirely
|
|
|
200
|
+ * via this parameter.
|
|
|
201
|
+ *
|
|
|
202
|
+ * For the purposes of DOMPDF, pixels per inch (PPI) = dots per inch (DPI).
|
|
|
203
|
+ * If a size in html is given as px (or without unit as image size),
|
|
|
204
|
+ * this tells the corresponding size in pt.
|
|
|
205
|
+ * This adjusts the relative sizes to be similar to the rendering of the
|
|
|
206
|
+ * html page in a reference browser.
|
|
|
207
|
+ *
|
|
|
208
|
+ * In pdf, always 1 pt = 1/72 inch
|
|
|
209
|
+ *
|
|
|
210
|
+ * Rendering resolution of various browsers in px per inch:
|
|
|
211
|
+ * Windows Firefox and Internet Explorer:
|
|
|
212
|
+ * SystemControl->Display properties->FontResolution: Default:96, largefonts:120, custom:?
|
|
|
213
|
+ * Linux Firefox:
|
|
|
214
|
+ * about:config *resolution: Default:96
|
|
|
215
|
+ * (xorg screen dimension in mm and Desktop font dpi settings are ignored)
|
|
|
216
|
+ *
|
|
|
217
|
+ * Take care about extra font/image zoom factor of browser.
|
|
|
218
|
+ *
|
|
|
219
|
+ * In images, <img> size in pixel attribute, img css style, are overriding
|
|
|
220
|
+ * the real image dimension in px for rendering.
|
|
|
221
|
+ *
|
|
|
222
|
+ * @var int
|
|
|
223
|
+ */
|
|
|
224
|
+ "dpi" => 96,
|
|
|
225
|
+
|
|
|
226
|
+ /**
|
|
|
227
|
+ * Enable inline PHP
|
|
|
228
|
+ *
|
|
|
229
|
+ * If this setting is set to true then DOMPDF will automatically evaluate
|
|
|
230
|
+ * inline PHP contained within <script type="text/php"> ... </script> tags.
|
|
|
231
|
+ *
|
|
|
232
|
+ * Enabling this for documents you do not trust (e.g. arbitrary remote html
|
|
|
233
|
+ * pages) is a security risk. Set this option to false if you wish to process
|
|
|
234
|
+ * untrusted documents.
|
|
|
235
|
+ *
|
|
|
236
|
+ * @var bool
|
|
|
237
|
+ */
|
|
|
238
|
+ "enable_php" => false,
|
|
|
239
|
+
|
|
|
240
|
+ /**
|
|
|
241
|
+ * Enable inline Javascript
|
|
|
242
|
+ *
|
|
|
243
|
+ * If this setting is set to true then DOMPDF will automatically insert
|
|
|
244
|
+ * JavaScript code contained within <script type="text/javascript"> ... </script> tags.
|
|
|
245
|
+ *
|
|
|
246
|
+ * @var bool
|
|
|
247
|
+ */
|
|
|
248
|
+ "enable_javascript" => true,
|
|
|
249
|
+
|
|
|
250
|
+ /**
|
|
|
251
|
+ * Enable remote file access
|
|
|
252
|
+ *
|
|
|
253
|
+ * If this setting is set to true, DOMPDF will access remote sites for
|
|
|
254
|
+ * images and CSS files as required.
|
|
|
255
|
+ * This is required for part of test case www/test/image_variants.html through www/examples.php
|
|
|
256
|
+ *
|
|
|
257
|
+ * Attention!
|
|
|
258
|
+ * This can be a security risk, in particular in combination with DOMPDF_ENABLE_PHP and
|
|
|
259
|
+ * allowing remote access to dompdf.php or on allowing remote html code to be passed to
|
|
|
260
|
+ * $dompdf = new DOMPDF(, $dompdf->load_html(...,
|
|
|
261
|
+ * This allows anonymous users to download legally doubtful internet content which on
|
|
|
262
|
+ * tracing back appears to being downloaded by your server, or allows malicious php code
|
|
|
263
|
+ * in remote html pages to be executed by your server with your account privileges.
|
|
|
264
|
+ *
|
|
|
265
|
+ * @var bool
|
|
|
266
|
+ */
|
|
|
267
|
+ "enable_remote" => true,
|
|
|
268
|
+
|
|
|
269
|
+ /**
|
|
|
270
|
+ * A ratio applied to the fonts height to be more like browsers' line height
|
|
|
271
|
+ */
|
|
|
272
|
+ "font_height_ratio" => 1.1,
|
|
|
273
|
+
|
|
|
274
|
+ /**
|
|
|
275
|
+ * Use the HTML5 Lib parser
|
|
|
276
|
+ *
|
|
|
277
|
+ * @deprecated This feature is now always on in dompdf 2.x
|
|
|
278
|
+ * @var bool
|
|
|
279
|
+ */
|
|
|
280
|
+ "enable_html5_parser" => true,
|
|
|
281
|
+ ),
|
|
|
282
|
+
|
|
|
283
|
+
|
|
|
284
|
+);
|