PluginProbe
PDF & Print by BestWebSoft – WordPress Posts and Pages PDF Generator Plugin / trunk
PDF & Print by BestWebSoft – WordPress Posts and Pages PDF Generator Plugin vtrunk
trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.1 All 71 releases
← All changes | mpdf/config.php +598 -572 1.7.1trunk View file →
@@ -1,572 +1,598 @@
1 -<?php
2 -
3 -// mPDF 5.7
4 -// Specify whether to automatically generate bookmarks or ToC entries from h1 - h6 tags
5 -$this->h2bookmarks = array();
6 -$this->h2toc = array();
7 -/* Define arrays with e.g. the tag=>ToC-level
8 -Remember bookmark and ToC levels start at 0
9 -(does not work inside tables)
10 -Only the default ToC will be used if > 1 ToCs are defined for the document
11 -H1 - H6 must be uppercase
12 -$this->h2toc = array('H1'=>0, 'H2'=>1, 'H3'=>2);
13 -$this->h2bookmarks = array('H1'=>0, 'H2'=>1, 'H3'=>2);
14 -*/
15 -
16 -// mPDF 5.7
17 -// Text-align on decimal marks
18 -// Allowed characters for alignment on decimal marks. Additional codes must start with D
19 -// Non-ASCII characters should be in utf-8 encoding
20 -// DM - middot U+00B7
21 -// DA - arabic decimal mark U+066B
22 -$this->decimal_align = array('DP'=>'.', 'DC'=>',', 'DM'=>"\xc2\xb7", 'DA'=>"\xd9\xab", 'DD'=>'-');
23 -
24 -// PAGING
25 -$this->mirrorMargins = 0;
26 -$this->restoreBlockPagebreaks = false;
27 -$this->forcePortraitMargins = false;
28 -$this->displayDefaultOrientation = false;
29 -$this->printers_info = false; // Adds date and page info for printer when using @page and "marks:crop;"
30 -$this->bleedMargin = 5;
31 -$this->crossMarkMargin = 5; // Distance of cross mark from margin in mm
32 -$this->cropMarkMargin = 8; // Distance of crop mark from margin in mm
33 -$this->cropMarkLength = 18; // Default length in mm of crop line
34 -$this->nonPrintMargin = 8; // Non-printable border at edge of paper sheet in mm
35 -// mPDF 5.5
36 -// Avoid just the border/background-color of the end of a block being moved on to next page
37 -$this->margBuffer = 2; // Allows an (empty) end of block to extend beyond the bottom margin by this amount (mm)
38 -
39 -
40 -// PAGE NUMBERING
41 -$this->pagenumPrefix;
42 -$this->pagenumSuffix;
43 -$this->nbpgPrefix;
44 -$this->nbpgSuffix;
45 -
46 -
47 -// FONTS, LANGUAGES & CHARACTER SETS
48 -// Set maximum size of TTF font file to allow non-subsets - in kB
49 -// Used to avoid e.g. Arial Unicode MS (perhaps used for substitutions) to ever be fully embedded
50 -// NB Free serif is 1.5MB, most files are <= 600kB (most 200-400KB)
51 -$this->maxTTFFilesize = 2000;
52 -
53 -// this value determines whether to subset or not
54 -// 0 - 100 = percent characters
55 -// i.e. if ==40, mPDF will embed whole font if >40% characters in that font
56 -// or embed subset if <40% characters
57 -// 0 will force whole file to be embedded (NO subsetting)
58 -// 100 will force always to subset
59 -// This value is overridden if you set new mPDF('s)
60 -// and/or Can set at runtime
61 -$this->percentSubset = 30;
62 -
63 -$this->useAdobeCJK = false; // Uses Adobe CJK fonts for CJK languages
64 - // default TRUE; only set false if you have defined some available fonts that support CJK
65 - // If true this will not stop use of other CJK fonts if specified by font-family:
66 - // and vice versa i.e. only dictates behaviour when specified by lang="" incl. AutoFont()
67 -
68 -// When embedding full TTF font files, remakes the font file using only core tables
69 -// May improve function with some PostScript printers (GhostScript/GSView)
70 -// Does not work with TTC font collections
71 -// Slightly smaller file; increased processing time
72 -$this->repackageTTF = false;
73 -
74 -// Allows automatic character set conversion if "charset=xxx" detected in html header (WriteHTML() )
75 -$this->allow_charset_conversion = true;
76 -$this->biDirectional=false; // automatically determine BIDI text in LTR page
77 -$this->autoFontGroupSize = 2; // 1: individual words are spanned; 2: words+; 3: as big chunks as possible.
78 -$this->useLang = true; // Default changed in mPDF 4.0
79 -
80 -$this->useSubstitutions = false; // Substitute missing characters in UTF-8(multibyte) documents - from other fonts
81 -$this->falseBoldWeight = 5; // Weight for bold text when using an artificial (outline) bold; value 0 (off) - 10 (rec. max)
82 -
83 -// CONFIGURATION
84 -$this->allow_output_buffering = false;
85 -
86 -$this->enableImports = false; // Adding mPDFI functions
87 -
88 -$this->collapseBlockMargins = true; // Allows top and bottom margins to collapse between block elements
89 -$this->progressBar = 0; // Shows progress-bars whilst generating file 0 off, 1 simple, 2 advanced
90 -$this->progbar_heading = 'mPDF file progress';
91 -$this->progbar_altHTML = ''; // Should include <html> and <body> but NOT end tags
92 - // Can incude <head> and link to stylesheet etc.
93 - // e.g. '<html><body><p><img src="loading.gif" /> Creating PDF file. Please wait...</p>';
94 -
95 -$this->dpi = 96; // To interpret "px" pixel values in HTML/CSS (see img_dpi below)
96 -
97 -// Automatically correct for tags where HTML specifies optional end tags e.g. P,LI,DD,TD
98 -// If you are confident input html is valid XHTML, turning this off may make it more reliable(?)
99 -$this->allow_html_optional_endtags = true;
100 -
101 -$this->ignore_invalid_utf8 = false;
102 -$this->text_input_as_HTML = false; // Converts all entities in Text inputs to UTF-8 before encoding
103 -$this->useGraphs = false;
104 -
105 -
106 -// When writing a block element with position:fixed and overflow:auto, mPDF scales it down to fit in the space
107 -// by repeatedly rewriting it and making adjustments. These values give the adjustments used, depending how far out
108 -// the previous guess was. The lower the number, the quicker it will finish, but the less accurate the fit may be.
109 -// FPR1 is for coarse adjustments, and FPR4 for fine adjustments when it is getting closer.
110 -$this->incrementFPR1 = 10; // i.e. will alter by 1/[10]th of width and try again until within closer limits
111 -$this->incrementFPR2 = 20;
112 -$this->incrementFPR3 = 30;
113 -$this->incrementFPR4 = 50; // i.e. will alter by 1/[50]th of width and try again when it nearly fits
114 -
115 -
116 -// COLORSPACE
117 -// 1 - allow GRAYSCALE only [convert CMYK/RGB->gray]
118 -// 2 - allow RGB / SPOT COLOR / Grayscale [convert CMYK->RGB]
119 -// 3 - allow CMYK / SPOT COLOR / Grayscale [convert RGB->CMYK]
120 -$this->restrictColorSpace = 0;
121 -
122 -// PDFX/1-a Compliant files
123 -$this->PDFX = false; // true=Forces compliance with PDFX-1a spec
124 - // Cannot be used with $this->restrictColorSpace (i.e. no RGB)
125 -$this->PDFXauto = false; // Overrides warnings making changes when possible to force PDFX1-a compliance
126 -
127 -
128 -// PDFA1-b Compliant files
129 -$this->PDFA = false; // true=Forces compliance with PDFA-1b spec
130 - // Can use with $this->restrictColorSpace=3 (for a CMYK file)
131 - // Any other settings, uses RGB profile
132 -$this->PDFAauto = false; // Overrides warnings making changes when possible to force PDFA1-b compliance
133 -$this->ICCProfile = ''; // Colour profile OutputIntent
134 - // sRGB_IEC61966-2-1 (=default if blank and PDFA), or other added .icc profile
135 - // Must be CMYK for PDFX, or appropriate type for PDFA(RGB or CMYK)
136 -
137 -
138 -
139 -// DEBUGGING & DEVELOPERS
140 -$this->showStats = false;
141 -$this->debug = false;
142 -$this->debugfonts = false; // Checks and reports on errors when parsing TTF files - adds significantly to processing time
143 -$this->showImageErrors = false;
144 -$this->table_error_report = false; // Die and report error if table is too wide to contain whole words
145 -$this->table_error_report_param = ''; // Parameter which can be passed to show in error report i.e. chapter number being processed//
146 -
147 -
148 -// ANNOTATIONS
149 -$this->title2annots = false;
150 -$this->annotSize = 0.5; // default mm for Adobe annotations - nominal
151 -$this->annotMargin; // default position for Annotations
152 -$this->annotOpacity = 0.5; // default opacity for Annotations
153 -
154 -// BOOKMARKS
155 -$this->anchor2Bookmark = 0; // makes <a name=""> into a bookmark as well as internal link target; 1 = just name; 2 = name (p.34)
156 -// Set an optional array to specify appearance of Bookmarks (by level)
157 -// Default values are Black and normal style
158 -/*
159 - Example:
160 -$this->bookmarkStyles = array(
161 - 0 => array('color'=> array(0,64,128), 'style'=>'B'),
162 - 1 => array('color'=> array(128,0,0), 'style'=>''),
163 - 2 => array('color'=> array(0,128,0), 'style'=>'I'),
164 -);
165 -*/
166 -$this->bookmarkStyles = array();
167 -
168 -
169 -// CSS & STYLES
170 -$this->CSSselectMedia='print'; // screen, print, or any other CSS @media type (not "all")
171 -
172 -
173 -// PAGE HEADERS & FOOTERS
174 -$this->forcePortraitHeaders = false;
175 -// Values used if simple FOOTER/HEADER given i.e. not array
176 -$this->defaultheaderfontsize = 8; // pt
177 -$this->defaultheaderfontstyle = 'BI'; // '', or 'B' or 'I' or 'BI'
178 -$this->defaultheaderline = 1; // 1 or 0 - line under the header
179 -$this->defaultfooterfontsize = 8; // pt
180 -$this->defaultfooterfontstyle = 'BI'; // '', or 'B' or 'I' or 'BI'
181 -$this->defaultfooterline = 1; // 1 or 0 - line over the footer
182 -$this->header_line_spacing = 0.25; // spacing between bottom of header and line (if present) - function of fontsize
183 -$this->footer_line_spacing = 0.25; // spacing between bottom of header and line (if present) - function of fontsize
184 -// If 'pad' margin-top sets fixed distance in mm (padding) between bottom of header and top of text.
185 -// If 'stretch' margin-top sets a minimum distance in mm between top of page and top of text, which expands if header is too large to fit.
186 -$this->setAutoTopMargin = false;
187 -$this->setAutoBottomMargin = false;
188 -$this->autoMarginPadding = 2; // distance in mm used as padding if 'stretch' mode is used
189 -
190 -
191 -
192 -// TABLES
193 -$this->simpleTables = false; // Forces all cells to have same border, background etc. Improves performance
194 -$this->packTableData = false; // Reduce memory usage processing tables (but with increased processing time)
195 -// Using disk to cache table data can reduce memory usage dramatically, but at a cost of increased
196 -// executon time and disk access (read and write)
197 -$this->cacheTables = false;
198 -
199 -$this->ignore_table_percents = false;
200 -$this->ignore_table_widths = false;
201 -$this->keep_table_proportions = false; // If table width set > page width, force resizing but keep relative sizes
202 - // Also forces respect of cell widths set by %
203 -$this->shrink_tables_to_fit = 1.4; // automatically reduce fontsize in table if words would have to split ( not in CJK)
204 - // 0 or false to disable; value (if set) gives maximum factor to reduce fontsize
205 -
206 -$this->tableMinSizePriority = false; // If page-break-inside:avoid but cannot fit on full page without
207 - // exceeding autosize; setting this value to true will force respsect for
208 - // autosize, and disable the page-break-inside:avoid
209 -
210 -$this->use_kwt = false; // "Keep-with-table"
211 -$this->iterationCounter = false; // Set to TRUE to use table Head iteration counter
212 -$this->splitTableBorderWidth = 0; // Use table border (using this width in mm) when table breaks across pages
213 - // Recommended to use small value e.g. 0.01
214 -
215 -
216 -// IMAGES
217 -$this->img_dpi = 96; // Default dpi to output images if size not defined
218 - // See also above "dpi"
219 -
220 -// TEXT SPACING & JUSTIFICATION
221 -$this->useKerning = false; // true to use kerning
222 -$this->justifyB4br = false; // In justified text, <BR> does not cause the preceding text to be justified in browsers
223 - // Change to true to force justification (as in MS Word)
224 -
225 -$this->tabSpaces = 8; // Number of spaces to replace for a TAB in <pre> sections
226 - // Notepad uses 6, HTML specification recommends 8
227 -$this->jSWord = 0.4; // Proportion (/1) of space (when justifying margins) to allocate to Word vs. Character
228 -$this->jSmaxChar = 2; // Maximum spacing to allocate to character spacing. (0 = no maximum)
229 -
230 -$this->jSmaxCharLast = 1; // Maximum character spacing allowed (carried over) when finishing a last line
231 -$this->jSmaxWordLast = 2; // Maximum word spacing allowed (carried over) when finishing a last line
232 -$this->normalLineheight = 1.33; // Value used for line-height when CSS specified as 'normal' (default)
233 -
234 -// Small Caps
235 -$this->smCapsScale = 0.75; // Factor of 1 to scale capital letters
236 -$this->smCapsStretch = 110; // % to stretch small caps horizontally (i.e. 100 = no stretch)
237 -
238 -// CJK Line-breaking
239 -$this->allowCJKorphans = true; // FALSE=always wrap to next line; TRUE=squeeze or overflow
240 -$this->allowCJKoverflow = false; // FALSE=squeeze; TRUE=overflow (only some characters, and disabled in tables)
241 -$this->CJKforceend = false; // Forces overflowng punctuation to hang outside right margin mPDF 5.6.40
242 -
243 -// HYPHENATION
244 -$this->SHYlang = "en"; // Should be one of: 'en','de','es','fi','fr','it','nl','pl','ru','sv'
245 -$this->SHYleftmin = 2;
246 -$this->SHYrightmin = 2;
247 -$this->SHYcharmin = 2;
248 -$this->SHYcharmax = 10;
249 -
250 -// COLUMNS
251 -$this->keepColumns = false; // Set to go to the second column only when the first is full of text etc.
252 -$this->max_colH_correction = 1.15; // Maximum ratio to adjust column height when justifying - too large a value can give ugly results
253 -$this->ColGap=5;
254 -
255 -
256 -// LISTS
257 -$this->list_align_style = 'R'; // Determines alignment of numbers in numbered lists
258 -$this->list_indent_first_level = 0; // 1/0 yex/no to indent first level of list
259 -$this->list_number_suffix = '.'; // Content to follow a numbered list marker e.g. '.' gives 1. or IV.; ')' gives 1) or a)
260 -
261 -// ACTIVE FORMS
262 -$this->useActiveForms = false;
263 -
264 -// WATERMARKS
265 -$this->watermarkImgBehind = false;
266 -$this->showWatermarkText = 0;
267 -$this->showWatermarkImage = 0;
268 -$this->watermarkText = '';
269 -$this->watermarkImage = '';
270 -$this->watermark_font = '';
271 -$this->watermarkTextAlpha = 0.2;
272 -$this->watermarkImageAlpha = 0.2;
273 -$this->watermarkImgAlphaBlend = 'Normal';
274 - // Accepts any PDF spec. value: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn,
275 - // HardLight, SoftLight, Difference, Exclusion
276 - // "Multiply" works well for watermark image on top
277 -
278 -// BORDERS
279 -$this->autoPadding = false; // Automatically increases padding in block elements when border-radius set - if required
280 -
281 -
282 -//////////////////////////////////////////////
283 -
284 -// Default values if no style sheet offered (cf. http://www.w3.org/TR/CSS21/sample.html)
285 -$this->defaultCSS = array(
286 - 'BODY' => array(
287 - 'FONT-FAMILY' => 'serif',
288 - 'FONT-SIZE' => '11pt',
289 - 'TEXT-INDENT' => '0pt',
290 - 'LINE-HEIGHT' => 'normal',
291 - 'MARGIN-COLLAPSE' => 'collapse', /* Custom property to collapse top/bottom margins at top/bottom of page - ignored in tables/lists */
292 - 'HYPHENS' => 'manual', /* mPDF 5.6.08 */
293 - ),
294 - 'P' => array(
295 - 'MARGIN' => '1.12em 0',
296 - ),
297 - 'H1' => array(
298 - 'FONT-SIZE' => '2em',
299 - 'FONT-WEIGHT' => 'bold',
300 - 'MARGIN' => '0.67em 0',
301 - 'PAGE-BREAK-AFTER' => 'avoid',
302 - ),
303 - 'H2' => array(
304 - 'FONT-SIZE' => '1.5em',
305 - 'FONT-WEIGHT' => 'bold',
306 - 'MARGIN' => '0.75em 0',
307 - 'PAGE-BREAK-AFTER' => 'avoid',
308 - ),
309 - 'H3' => array(
310 - 'FONT-SIZE' => '1.17em',
311 - 'FONT-WEIGHT' => 'bold',
312 - 'MARGIN' => '0.83em 0',
313 - 'PAGE-BREAK-AFTER' => 'avoid',
314 - ),
315 - 'H4' => array(
316 - 'FONT-WEIGHT' => 'bold',
317 - 'MARGIN' => '1.12em 0',
318 - 'PAGE-BREAK-AFTER' => 'avoid',
319 - ),
320 - 'H5' => array(
321 - 'FONT-SIZE' => '0.83em',
322 - 'FONT-WEIGHT' => 'bold',
323 - 'MARGIN' => '1.5em 0',
324 - 'PAGE-BREAK-AFTER' => 'avoid',
325 - ),
326 - 'H6' => array(
327 - 'FONT-SIZE' => '0.75em',
328 - 'FONT-WEIGHT' => 'bold',
329 - 'MARGIN' => '1.67em 0',
330 - 'PAGE-BREAK-AFTER' => 'avoid',
331 - ),
332 - 'HR' => array(
333 - 'COLOR' => '#888888',
334 - 'TEXT-ALIGN' => 'center',
335 - 'WIDTH' => '100%',
336 - 'HEIGHT' => '0.2mm',
337 - 'MARGIN-TOP' => '0.83em',
338 - 'MARGIN-BOTTOM' => '0.83em',
339 - ),
340 - 'PRE' => array(
341 - 'MARGIN' => '0.83em 0',
342 - 'FONT-FAMILY' => 'monospace',
343 - ),
344 - 'S' => array(
345 - 'TEXT-DECORATION' => 'line-through',
346 - ),
347 - 'STRIKE' => array(
348 - 'TEXT-DECORATION' => 'line-through',
349 - ),
350 - 'DEL' => array(
351 - 'TEXT-DECORATION' => 'line-through',
352 - ),
353 - 'SUB' => array(
354 - 'VERTICAL-ALIGN' => 'sub',
355 - 'FONT-SIZE' => '55%', /* Recommended 0.83em */
356 - ),
357 - 'SUP' => array(
358 - 'VERTICAL-ALIGN' => 'super',
359 - 'FONT-SIZE' => '55%', /* Recommended 0.83em */
360 - ),
361 - 'U' => array(
362 - 'TEXT-DECORATION' => 'underline',
363 - ),
364 - 'INS' => array(
365 - 'TEXT-DECORATION' => 'underline',
366 - ),
367 - 'B' => array(
368 - 'FONT-WEIGHT' => 'bold',
369 - ),
370 - 'STRONG' => array(
371 - 'FONT-WEIGHT' => 'bold',
372 - ),
373 - 'I' => array(
374 - 'FONT-STYLE' => 'italic',
375 - ),
376 - 'CITE' => array(
377 - 'FONT-STYLE' => 'italic',
378 - ),
379 - 'Q' => array(
380 - 'FONT-STYLE' => 'italic',
381 - ),
382 - 'EM' => array(
383 - 'FONT-STYLE' => 'italic',
384 - ),
385 - 'VAR' => array(
386 - 'FONT-STYLE' => 'italic',
387 - ),
388 - 'SAMP' => array(
389 - 'FONT-FAMILY' => 'monospace',
390 - ),
391 - 'CODE' => array(
392 - 'FONT-FAMILY' => 'monospace',
393 - ),
394 - 'KBD' => array(
395 - 'FONT-FAMILY' => 'monospace',
396 - ),
397 - 'TT' => array(
398 - 'FONT-FAMILY' => 'monospace',
399 - ),
400 - 'SMALL' => array(
401 - 'FONT-SIZE' => '83%',
402 - ),
403 - 'BIG' => array(
404 - 'FONT-SIZE' => '117%',
405 - ),
406 - 'ACRONYM' => array(
407 - 'FONT-SIZE' => '77%',
408 - 'FONT-WEIGHT' => 'bold',
409 - ),
410 - 'ADDRESS' => array(
411 - 'FONT-STYLE' => 'italic',
412 - ),
413 - 'BLOCKQUOTE' => array(
414 - 'MARGIN-LEFT' => '40px',
415 - 'MARGIN-RIGHT' => '40px',
416 - 'MARGIN-TOP' => '1.12em',
417 - 'MARGIN-BOTTOM' => '1.12em',
418 - ),
419 - 'A' => array(
420 - 'COLOR' => '#0000FF',
421 - 'TEXT-DECORATION' => 'underline',
422 - ),
423 - 'UL' => array(
424 - 'MARGIN' => '0.83em 0', /* only applied to top-level of nested lists */
425 - 'TEXT-INDENT' => '1.3em', /* Custom effect - list indent */
426 - ),
427 - 'OL' => array(
428 - 'MARGIN' => '0.83em 0', /* only applied to top-level of nested lists */
429 - 'TEXT-INDENT' => '1.3em', /* Custom effect - list indent */
430 - ),
431 - 'DL' => array(
432 - 'MARGIN' => '1.67em 0',
433 - ),
434 - 'DT' => array(
435 - ),
436 - 'DD' => array(
437 - 'PADDING-LEFT' => '40px',
438 - ),
439 - 'TABLE' => array(
440 - 'MARGIN' => '0',
441 - 'BORDER-COLLAPSE' => 'separate',
442 - 'BORDER-SPACING' => '2px',
443 - 'EMPTY-CELLS' => 'show',
444 - 'LINE-HEIGHT' => '1.2',
445 - 'VERTICAL-ALIGN' => 'middle',
446 - ),
447 - 'THEAD' => array(
448 - ),
449 - 'TFOOT' => array(
450 - ),
451 - 'TH' => array(
452 - 'FONT-WEIGHT' => 'bold',
453 - 'TEXT-ALIGN' => 'center',
454 - 'PADDING-LEFT' => '0.1em',
455 - 'PADDING-RIGHT' => '0.1em',
456 - 'PADDING-TOP' => '0.1em',
457 - 'PADDING-BOTTOM' => '0.1em',
458 - ),
459 - 'TD' => array(
460 - 'PADDING-LEFT' => '0.1em',
461 - 'PADDING-RIGHT' => '0.1em',
462 - 'PADDING-TOP' => '0.1em',
463 - 'PADDING-BOTTOM' => '0.1em',
464 - ),
465 - 'CAPTION' => array(
466 - 'TEXT-ALIGN' => 'center',
467 - ),
468 - 'IMG' => array(
469 - 'MARGIN' => '0',
470 - 'VERTICAL-ALIGN' => 'baseline',
471 - ),
472 - 'INPUT' => array(
473 - 'FONT-FAMILY' => 'sans-serif',
474 - 'VERTICAL-ALIGN' => 'middle',
475 - 'FONT-SIZE' => '0.9em',
476 - ),
477 - 'SELECT' => array(
478 - 'FONT-FAMILY' => 'sans-serif',
479 - 'FONT-SIZE' => '0.9em',
480 - 'VERTICAL-ALIGN' => 'middle',
481 - ),
482 - 'TEXTAREA' => array(
483 - 'FONT-FAMILY' => 'monospace',
484 - 'FONT-SIZE' => '0.9em',
485 - 'VERTICAL-ALIGN' => 'text-bottom',
486 - ),
487 - 'MARK' => array( /* mPDF 5.5.09 */
488 - 'BACKGROUND-COLOR' => 'yellow',
489 - ),
490 -);
491 -
492 -
493 -//////////////////////////////////////////////////
494 -// VALUES ONLY LIKELY TO BE CHANGED BY DEVELOPERS
495 -//////////////////////////////////////////////////
496 -$this->pdf_version = '1.4';
497 -
498 -// Hyphenation
499 -$this->SHYlanguages = array('en','de','es','fi','fr','it','nl','pl','ru','sv'); // existing defined patterns
500 -
501 -$this->default_lineheight_correction=1.2; // Value 1 sets lineheight=fontsize height;
502 - // Value used if line-height not set by CSS (usuallly is)
503 -
504 -$this->fontsizes = array('XX-SMALL'=>0.7, 'X-SMALL'=>0.77, 'SMALL'=>0.86, 'MEDIUM'=>1, 'LARGE'=>1.2, 'X-LARGE'=>1.5, 'XX-LARGE'=>2);
505 -
506 -// CHARACTER PATTERN MATCHES TO DETECT LANGUAGES
507 - // pattern used to detect RTL characters -> force RTL
508 - $this->pregRTLchars = "\x{0590}-\x{06FF}\x{0700}-\x{083E}\x{FB00}-\x{FDFD}\x{FE70}-\x{FEFF}";
509 -
510 - // CJK Chars which require changing and are distinctive of specific charset
511 - $this->pregUHCchars = "\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}";
512 - $this->pregSJISchars = "\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3190}-\x{319F}\x{31F0}-\x{31FF}";
513 -
514 - // Chars which distinguish CJK but not between different
515 - $this->pregCJKchars = "\x{1100}-\x{11FF}\x{2E80}-\x{A4CF}\x{A800}-\x{D7AF}\x{F900}-\x{FAFF}\x{FE30}-\x{FE6F}\x{FF00}-\x{FFEF}\x{20000}-\x{2FA1F}";
516 -
517 - // For CJK Line-breaking
518 - //Leading characters - Not allowed at end of line
519 - $this->CJKleading = "\$\(\*\[\{\x{00a3}\x{00a5}\x{00ab}\x{00b7}\x{2018}\x{201c}\x{2035}\x{3005}\x{3007}\x{3008}\x{300a}\x{300c}\x{300e}\x{3010}\x{3014}\x{3016}\x{3018}\x{301d}\x{fe34}\x{fe57}\x{fe59}\x{fe5b}\x{ff04}\x{ff08}\x{ff0e}\x{ff3b}\x{ff5b}\x{ff5f}\x{ffe1}\x{ffe5}\x{ffe6}";
520 - // Following characters - Not allowed at start
521 - $this->CJKfollowing = "!%\),\.:;>\?\]\}\x{00a2}\x{00a8}\x{00b0}\x{00b7}\x{00bb}\x{02c7}\x{02c9}\x{2010}\x{2013}-\x{2016}\x{2019}\x{201d}-\x{201f}\x{2020}-\x{2022}\x{2025}\x{2027}\x{203a}\x{203c}\x{2047}-\x{2049}\x{2103}\x{2236}\x{2574}\x{3001}-\x{3003}\x{3005}\x{3006}\x{3009}\x{300b}\x{300d}\x{300f}\x{3011}\x{3015}\x{3017}\x{3019}\x{301c}\x{301e}\x{301f}\x{303b}\x{3041}\x{3043}\x{3045}\x{3047}\x{3049}\x{3063}\x{3083}\x{3085}\x{3087}\x{308e}\x{3095}\x{3096}\x{30a0}\x{30a1}\x{30a3}\x{30a5}\x{30a7}\x{30a9}\x{30c3}\x{30e3}\x{30e5}\x{30e7}\x{30ee}\x{30f5}\x{30f6}\x{30fb}-\x{30fe}\x{31f0}-\x{31ff}\x{fe30}-\x{fe33}\x{fe50}-\x{fe56}\x{fe58}\x{fe5a}\x{fe5c}\x{ff01}\x{ff02}\x{ff05}\x{ff07}\x{ff09}\x{ff0c}\x{ff0e}\x{ff1a}\x{ff1b}\x{ff1f}\x{ff3d}\x{ff40}\x{ff5c}-\x{ff5e}\x{ff60}\x{ff64}";
522 - // Characters which are allowed to overflow the right margin
523 - $this->CJKoverflow = "\.,\x{ff61}\x{ff64}\x{3001}\x{3002}\x{ff0c}\x{ff0e}";
524 -
525 -
526 -
527 - // ASCII Chars which shouldn't break string
528 - // Use for very specific words
529 - $this->pregASCIIchars1 = "\x{0021}-\x{002E}\x{0030}-\x{003B}?"; // no [SPACE]
530 - // Use for words+
531 - $this->pregASCIIchars2 = "\x{0020}-\x{002E}\x{0030}-\x{003B}?"; // [SPACE] punctuation and 0-9
532 - // Use for chunks > words
533 - $this->pregASCIIchars3 = "\x{0000}-\x{002E}\x{0030}-\x{003B}\x{003F}-\x{007E}"; // all except <>
534 - // Vietnamese - specific
535 - $this->pregVIETchars = "\x{01A0}\x{01A1}\x{01AF}\x{01B0}\x{1EA0}-\x{1EF1}";
536 - // Vietnamese - Chars which shouldn't break string
537 - $this->pregVIETPluschars = "\x{0000}-\x{003B}\x{003F}-\x{00FF}\x{0300}-\x{036F}\x{0102}\x{0103}\x{0110}\x{0111}\x{0128}\x{0129}\x{0168}\x{0169}\x{1EF1}-\x{1EF9}"; // omits < >
538 -
539 - // Arabic
540 - $this->pregARABICchars = "\x{0600}-\x{06FF}\x{0750}-\x{077F}\x{FB50}-\x{FDFD}\x{FE70}-\x{FEFF}";
541 - // Characters of Urdu, Pashto, Sindhi (but NOT arabic or persian/farsi) [not covered by DejavuSans font]
542 - $this->pregNonARABICchars = "\x{0671}-\x{067D}\x{067F}-\x{0685}\x{0687}-\x{0697}\x{0699}-\x{06A8}\x{06AA}-\x{06AE}\x{06B0}-\x{06CB}\x{06CD}-\x{06D3}";
543 -
544 - $this->pregHEBchars = "\x{0590}-\x{05FF}\x{FB00}-\x{FB49}"; // Hebrew
545 -
546 - // INDIC
547 - $this->pregHIchars = "\x{0900}-\x{0963}\x{0966}-\x{097F}"; // Devanagari (Hindi) minus the common indic punctuation 0964,0965
548 - $this->pregBNchars = "\x{0980}-\x{09FF}"; // Bengali
549 - $this->pregPAchars = "\x{0A00}-\x{0A7F}"; // Gurmukhi (Punjabi)
550 - $this->pregGUchars = "\x{0A80}-\x{0AFF}"; // Gujarati
551 - $this->pregORchars = "\x{0B00}-\x{0B7F}"; // Oriya
552 - $this->pregTAchars = "\x{0B80}-\x{0BFF}"; // Tamil
553 - $this->pregTEchars = "\x{0C00}-\x{0C7F}"; // Telugu
554 - $this->pregKNchars = "\x{0C80}-\x{0CFF}"; // Kannada
555 - $this->pregMLchars = "\x{0D00}-\x{0D7F}"; // Malayalam
556 - $this->pregSHchars = "\x{0D80}-\x{0DFF}"; // Sinhala
557 -
558 - $this->pregINDextra = "\x{200B}-\x{200D}\x{0964}\x{0965}\x{0020}-\x{0022}\x{0024}-\x{002E}\x{003A}-\x{003F}\x{005B}-\x{0060}\x{007B}-\x{007E}\x{00A0}";
559 - // 200B-D=Zero-width joiners; 0964,0965=Generic Indic punctuation; NBSP & general punctuation (excludes # and / so can use in autoFont() )
560 -
561 -$this->allowedCSStags = 'DIV|P|H1|H2|H3|H4|H5|H6|FORM|IMG|A|BODY|TABLE|HR|THEAD|TFOOT|TBODY|TH|TR|TD|UL|OL|LI|PRE|BLOCKQUOTE|ADDRESS|DL|DT|DD';
562 -$this->allowedCSStags .= '|ARTICLE|ASIDE|FIGURE|FIGCAPTION|FOOTER|HEADER|HGROUP|NAV|SECTION|MARK|DETAILS|SUMMARY|METER|PROGRESS|TIME'; // mPDF 5.5.09
563 -$this->allowedCSStags .= '|SPAN|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|STRIKE|S|U|DEL|INS|Q|FONT';
564 -$this->allowedCSStags .= '|SELECT|INPUT|TEXTAREA|CAPTION|FIELDSET|LEGEND'; // mPDF 5.4.18
565 -$this->allowedCSStags .= '|TEXTCIRCLE|DOTTAB'; // mPDF 5.5.23 // mPDF 5.6.33
566 -
567 -$this->outerblocktags = array('DIV','FORM','CENTER','DL','FIELDSET','ARTICLE','ASIDE','FIGURE','FIGCAPTION', 'FOOTER','HEADER','HGROUP','NAV','SECTION','DETAILS','SUMMARY'); // mPDF 5.5.09 // mPDF 5.5.22
568 -$this->innerblocktags = array('P','BLOCKQUOTE','ADDRESS','PRE','H1','H2','H3','H4','H5','H6','DT','DD','CAPTION');
569 -
570 -
571 -
572 -?>
1 +<?php
2 +
3 +// PAGING
4 +$this->mirrorMargins = 0;
5 +$this->forcePortraitMargins = false;
6 +$this->displayDefaultOrientation = false;
7 +$this->printers_info = false; // Adds date and page info for printer when using @page and "marks:crop;"
8 +$this->bleedMargin = 5;
9 +$this->crossMarkMargin = 5; // Distance of cross mark from margin in mm
10 +$this->cropMarkMargin = 8; // Distance of crop mark from margin in mm
11 +$this->cropMarkLength = 18; // Default length in mm of crop line
12 +$this->nonPrintMargin = 8; // Non-printable border at edge of paper sheet in mm
13 +$this->defaultPagebreakType = 'cloneall'; // 'slice' or 'cloneall' or 'clonebycss' - for forced pagebreaks using <pagebreak />
14 +// Automatic pagebreaks (flow in text) are always 'slice'
15 +
16 +// Avoid just the border/background-color of the end of a block being moved on to next page
17 +$this->margBuffer = 2; // Allows an (empty) end of block to extend beyond the bottom margin by this amount (mm)
18 +
19 +// PAGE NUMBERING
20 +$this->pagenumPrefix = '';
21 +$this->pagenumSuffix = '';
22 +$this->nbpgPrefix = '';
23 +$this->nbpgSuffix = '';
24 +$this->defaultPageNumStyle = '1'; // 1:Decimal, A:uppercase alphabetic etc. (as for list-style shorthands)
25 +
26 +// FONTS, LANGUAGES & CHARACTER SETS
27 +// Set maximum size of TTF font file to allow non-subsets - in kB
28 +// Used to avoid a font e.g. Arial Unicode MS (perhaps used for substitutions) ever being fully embedded
29 +// NB Free serif is 1.5MB, most files are <= 600kB (most 200-400KB)
30 +$this->maxTTFFilesize = 2000;
31 +
32 +// this value determines whether to subset or not
33 +// 0 - 100 = percent characters
34 +// i.e. if ==40, mPDF will embed whole font if >40% characters in that font
35 +// or embed subset if <40% characters
36 +// 0 will force whole file to be embedded (NO subsetting)
37 +// 100 will force always to subset
38 +// This value is overridden if you set new mPDF('s')
39 +// and/or Can set at runtime
40 +$this->percentSubset = 30;
41 +
42 +$this->useAdobeCJK = false; // Uses Adobe CJK fonts for CJK languages
43 +// default TRUE; only set false if you have defined some available fonts that support CJK
44 +// If true this will not stop use of other CJK fonts if specified by font-family:
45 +// and vice versa i.e. only dictates behaviour when specified by lang="" incl. AutoFont()
46 +
47 +// // When embedding full TTF font files, remakes the font file using only core tables
48 +// May improve function with some PostScript printers (GhostScript/GSView)
49 +// Does not work with TTC font collections
50 +// Slightly smaller file; increased processing time
51 +$this->repackageTTF = false;
52 +
53 +// Allows automatic character set conversion if "charset=xxx" detected in html header (WriteHTML() )
54 +$this->allow_charset_conversion = true;
55 +$this->biDirectional = false; // automatically determine BIDI text in LTR page
56 +
57 +// AUTOMATIC FONT SELECTION
58 +// Based on script and/or language
59 +$this->autoScriptToLang = false; // mPDF 6.0 (similar to previously using function SetAutoFont() )
60 +$this->baseScript = 1; // =Latin; to set another base script see constants in classes/ucdn.php
61 +$this->autoVietnamese = true;
62 +$this->autoArabic = true;
63 +
64 +$this->autoLangToFont = false; // mPDF 6.0 (similar to old useLang)
65 +
66 +$this->useSubstitutions = false; // Substitute missing characters in UTF-8(multibyte) documents - from other fonts
67 +$this->falseBoldWeight = 5; // Weight for bold text when using an artificial (outline) bold; value 0 (off) - 10 (rec. max)
68 +
69 +// CONFIGURATION
70 +$this->allow_output_buffering = false;
71 +
72 +$this->enableImports = false; // Adding mPDFI functions
73 +
74 +$this->collapseBlockMargins = true; // Allows top and bottom margins to collapse between block elements
75 +$this->progressBar = 0; // Shows progress-bars whilst generating file 0 off, 1 simple, 2 advanced
76 +$this->progbar_heading = 'mPDF file progress';
77 +
78 +$this->progbar_altHTML = ''; // Should include <html> and <body> but NOT end tags
79 +// Can include <head> and link to stylesheet etc.
80 +// e.g. '<html><body><p><img src="loading.gif" /> Creating PDF file. Please wait...</p>';
81 +
82 +$this->dpi = 96; // To interpret "px" pixel values in HTML/CSS (see img_dpi below)
83 +// Automatically correct for tags where HTML specifies optional end tags e.g. P,LI,DD,TD
84 +// If you are confident input html is valid XHTML, turning this off may make it more reliable(?)
85 +$this->allow_html_optional_endtags = true;
86 +
87 +$this->ignore_invalid_utf8 = false;
88 +$this->text_input_as_HTML = false; // Converts all entities in Text inputs to UTF-8 before encoding
89 +$this->useGraphs = false;
90 +
91 +
92 +// When writing a block element with position:fixed and overflow:auto, mPDF scales it down to fit in the space
93 +// by repeatedly rewriting it and making adjustments. These values give the adjustments used, depending how far out
94 +// the previous guess was. The lower the number, the quicker it will finish, but the less accurate the fit may be.
95 +// FPR1 is for coarse adjustments, and FPR4 for fine adjustments when it is getting closer.
96 +$this->incrementFPR1 = 10; // i.e. will alter by 1/[10]th of width and try again until within closer limits
97 +$this->incrementFPR2 = 20;
98 +$this->incrementFPR3 = 30;
99 +$this->incrementFPR4 = 50; // i.e. will alter by 1/[50]th of width and try again when it nearly fits
100 +
101 +// COLORSPACE
102 +// 1 - allow GRAYSCALE only [convert CMYK/RGB->gray]
103 +// 2 - allow RGB / SPOT COLOR / Grayscale [convert CMYK->RGB]
104 +// 3 - allow CMYK / SPOT COLOR / Grayscale [convert RGB->CMYK]
105 +$this->restrictColorSpace = 0;
106 +
107 +// PDFX/1-a Compliant files
108 +$this->PDFX = false; // true=Forces compliance with PDFX-1a spec
109 +// Cannot be used with $this->restrictColorSpace (i.e. no RGB)
110 +$this->PDFXauto = false; // Overrides warnings making changes when possible to force PDFX1-a compliance
111 +
112 +// PDFA1-b Compliant files
113 +$this->PDFA = false; // true=Forces compliance with PDFA-1b spec
114 +// Can use with $this->restrictColorSpace=3 (for a CMYK file)
115 +// Any other settings, uses RGB profile
116 +$this->PDFAauto = false; // Overrides warnings making changes when possible to force PDFA1-b compliance
117 +$this->ICCProfile = ''; // Colour profile OutputIntent
118 +// sRGB_IEC61966-2-1 (=default if blank and PDFA), or other added .icc profile
119 +// Must be CMYK for PDFX, or appropriate type for PDFA(RGB or CMYK)
120 +
121 +// DEBUGGING & DEVELOPERS
122 +$this->showStats = false;
123 +$this->debug = false;
124 +$this->debugfonts = false; // Checks and reports on errors when parsing TTF files - adds significantly to processing time
125 +$this->showImageErrors = false;
126 +$this->table_error_report = false; // Die and report error if table is too wide to contain whole words
127 +$this->table_error_report_param = ''; // Parameter which can be passed to show in error report i.e. chapter number being processed//
128 +
129 +$this->title2annots = false; // Automatically convert title="" properties in tags, to annotations
130 +$this->annotSize = 0.5; // default mm for Adobe annotations - nominal
131 +$this->annotMargin; // default position for Annotations
132 +$this->annotOpacity = 0.5; // default opacity for Annotations
133 +
134 +// BOOKMARKS
135 +$this->anchor2Bookmark = 0; // makes <a name=""> into a bookmark as well as internal link target; 1 = just name; 2 = name (p.34)
136 +// Set an optional array to specify appearance of Bookmarks (by level)
137 +// Default values are Black and normal style
138 +/*
139 + Example:
140 + $this->bookmarkStyles = array(
141 + 0 => array('color'=> array(0,64,128), 'style'=>'B'),
142 + 1 => array('color'=> array(128,0,0), 'style'=>''),
143 + 2 => array('color'=> array(0,128,0), 'style'=>'I'),
144 + );
145 + */
146 +$this->bookmarkStyles = array();
147 +
148 +// Specify whether to automatically generate bookmarks from h1 - h6 tags
149 +$this->h2bookmarks = array();
150 +/* Define arrays with e.g. the tag=>Bookmark-level
151 + Remember bookmark levels start at 0
152 + (does not work inside tables)
153 + H1 - H6 must be uppercase
154 + $this->h2bookmarks = array('H1'=>0, 'H2'=>1, 'H3'=>2);
155 + */
156 +
157 +
158 +// TABLE OF CONTENTS
159 +// Specify whether to automatically generate ToC entries from h1 - h6 tags
160 +$this->h2toc = array();
161 +/* Define arrays with e.g. the tag=>ToC-level
162 + Remember ToC levels start at 0
163 + (does not work inside tables)
164 + Only the default ToC will be used if > 1 ToCs are defined for the document
165 + H1 - H6 must be uppercase
166 + $this->h2toc = array('H1'=>0, 'H2'=>1, 'H3'=>2);
167 + */
168 +
169 +// INDEX
170 +/* Specifies whether to repeat the main entry for each subEntry (true suppresses this)
171 +e.g. Mammal:dog ... Mammal:elephant ->
172 +[true]
173 +Mammal
174 +- dog
175 +- elephant
176 +[false]
177 +Mammal, dog
178 +Mammal, elephant
179 +*/
180 +$this->indexUseSubentries = true;
181 +
182 +
183 +// CSS & STYLES
184 +$this->CSSselectMedia = 'print'; // screen, print, or any other CSS @media type (except "all")
185 +
186 +// PAGE HEADERS & FOOTERS
187 +$this->forcePortraitHeaders = false;
188 +
189 +// Values used if simple FOOTER/HEADER given i.e. not array
190 +$this->defaultheaderfontsize = 8; // pt
191 +$this->defaultheaderfontstyle = 'BI'; // '', or 'B' or 'I' or 'BI'
192 +$this->defaultheaderline = 1; // 1 or 0 - line under the header
193 +$this->defaultfooterfontsize = 8; // pt
194 +$this->defaultfooterfontstyle = 'BI'; // '', or 'B' or 'I' or 'BI'
195 +$this->defaultfooterline = 1; // 1 or 0 - line over the footer
196 +$this->header_line_spacing = 0.25; // spacing between bottom of header and line (if present) - function of fontsize
197 +$this->footer_line_spacing = 0.25; // spacing between bottom of header and line (if present) - function of fontsize
198 +// If 'pad' margin-top sets fixed distance in mm (padding) between bottom of header and top of text.
199 +// If 'stretch' margin-top sets a minimum distance in mm between top of page and top of text, which expands if header is too large to fit.
200 +$this->setAutoTopMargin = false;
201 +$this->setAutoBottomMargin = false;
202 +$this->autoMarginPadding = 2; // distance in mm used as padding if 'stretch' mode is used
203 +
204 +// TABLES
205 +$this->simpleTables = false; // Forces all cells to have same border, background etc. Improves performance
206 +$this->packTableData = false; // Reduce memory usage processing tables (but with increased processing time)
207 +
208 +$this->ignore_table_percents = false;
209 +$this->ignore_table_widths = false;
210 +$this->keep_table_proportions = true; // If table width set > page width, force resizing but keep relative sizes
211 +// Also forces respect of cell widths set by %
212 +$this->shrink_tables_to_fit = 1.4; // automatically reduce fontsize in table if words would have to split ( not in CJK)
213 +// 0 or false to disable; value (if set) gives maximum factor to reduce fontsize
214 +
215 +$this->tableMinSizePriority = false; // If page-break-inside:avoid but cannot fit on full page without
216 +// exceeding autosize; setting this value to true will force respect for
217 +// autosize, and disable the page-break-inside:avoid
218 +
219 +$this->use_kwt = false; // "Keep-with-table" Attempts to keep a <h1> to <h6> tagged heading together
220 +// with a table which comes immediately after it.
221 +$this->iterationCounter = false; // Set to TRUE to use table Head iteration counter
222 +$this->splitTableBorderWidth = 0; // Use table border (using this width in mm) when table breaks across pages
223 +// Recommended to use small value e.g. 0.01
224 +
225 +// // Allowed characters for text alignment on decimal marks. Additional codes must start with D
226 +// DM - middot U+00B7
227 +// DA - arabic decimal mark U+066B
228 +$this->decimal_align = array('DP' => '.', 'DC' => ',', 'DM' => "\xc2\xb7", 'DA' => "\xd9\xab", 'DD' => '-');
229 +
230 +
231 +// IMAGES
232 +$this->interpolateImages = false; // if image-rendering=='auto', this defines value for image-rendering
233 +// if true, image interpolation shall be performed by a conforming reader
234 +$this->img_dpi = 96; // Default dpi to output images if size not defined
235 +// See also above "dpi"
236 +
237 +// TEXT SPACING & JUSTIFICATION
238 +
239 +$this->useKerning = false; // Specify whether kerning should be used when CSS font-kerning="auto" used for HTML;
240 +// Also whether kerning should be used in any direct writing e.g. $mpdf->Text();
241 +$this->justifyB4br = false; // In justified text, <BR> does not cause the preceding text to be justified in browsers
242 +// Change to true to force justification (as in MS Word)
243 +
244 +$this->tabSpaces = 8; // Number of spaces to replace for a TAB in <pre> sections
245 +// Notepad uses 6, HTML specification recommends 8
246 +$this->jSWord = 0.4; // Proportion (/1) of space (when justifying margins) to allocate to Word vs. Character
247 +$this->jSmaxChar = 2; // Maximum spacing to allocate to character spacing. (0 = no maximum)
248 +
249 +$this->jSmaxCharLast = 1; // Maximum character spacing allowed (carried over) when finishing a last line
250 +$this->jSmaxWordLast = 2; // Maximum word spacing allowed (carried over) when finishing a last line
251 +
252 +// LINE SPACING & TEXT BASELINE
253 +$this->useFixedNormalLineHeight = false; // Use the fixed factor ($this->normalLineheight) when line-height:normal
254 +// Compatible with mPDF versions < 6
255 +
256 +$this->useFixedTextBaseline = false; // Use a fixed ratio ($this->baselineC) to set the text baseline
257 +// Compatible with mPDF versions < 6
258 +
259 +$this->normalLineheight = 1.33; // Default Value used for line-height when CSS specified as 'normal' (default)
260 +
261 +$this->adjustFontDescLineheight = 1.14; // Correction factor applied to lineheight values derived from 'win', 'mac', 'winTypo'
262 +// Small Caps
263 +$this->smCapsScale = 0.75; // Factor of 1 to scale capital letters
264 +$this->smCapsStretch = 110; // % to stretch small caps horizontally (i.e. 100 = no stretch)
265 +// Line-breaking
266 +// The alternative to these next 2 is the use of U+200B Zero-width space
267 +// These are only effective if using OTL for the fonts
268 +$this->useDictionaryLBR = true; // Use the dictionaries to determine line-breaking in Lao, Khmer and Thai
269 +$this->useTibetanLBR = true; // Use the inbuilt algorithm to determine line-breaking in Tibetan
270 +
271 +// CJK Line-breaking
272 +$this->allowCJKorphans = true; // FALSE=always wrap to next line; TRUE=squeeze or overflow
273 +$this->allowCJKoverflow = false; // FALSE=squeeze; TRUE=overflow (only some characters, and disabled in tables)
274 +$this->CJKforceend = false; // Forces overflowng punctuation to hang outside right margin mPDF 5.6.40
275 +
276 +// HYPHENATION (using word dictionaries)
277 +$this->SHYlang = "en"; // Should be one of: 'en','de','es','fi','fr','it','nl','pl','ru','sv'
278 +$this->SHYleftmin = 2;
279 +$this->SHYrightmin = 2;
280 +$this->SHYcharmin = 2;
281 +$this->SHYcharmax = 10;
282 +
283 +// COLUMNS
284 +$this->keepColumns = false; // Set to go to the second column only when the first is full of text etc.
285 +$this->max_colH_correction = 1.15; // Maximum ratio to adjust column height when justifying - too large a value can give ugly results
286 +$this->ColGap = 5;
287 +
288 +
289 +// LISTS
290 +// mPDF 6
291 +$this->list_auto_mode = 'browser'; // 'mpdf' or 'browser' - Specify whether to use mPDF custom method of automatic
292 +// indentation of lists, or standard browser-compatible
293 +// custom mPDF method is ignored if list-style-position: inside, or image used for marker (or custom U+)
294 +$this->list_indent_default = '40px'; // List Indentation when set to 'auto' if using standard browser-compatible method
295 +$this->list_indent_default_mpdf = '0em'; // List Indentation when set to 'auto' if using mPDF custom method
296 +$this->list_indent_first_level = 0; // 1/0 yes/no to indent first level of list, if using mPDF custom method
297 +
298 +$this->list_number_suffix = '.'; // Content to follow a numbered list marker e.g. '.' gives 1. or IV.; ')' gives 1) or a)
299 +
300 +// To specify a bullet size and offset proportional to the list item's font size:
301 +//$this->list_marker_offset = '0.45em'; // Offset (CSS length) of list marker bullets (disc/circle/square)
302 +//$this->list_symbol_size = '0.31em'; // Size (CSS) of list marker bullets (disc/circle/square)
303 +// Browsers use a fixed bullet size and offset
304 +$this->list_marker_offset = '5.5pt'; // Offset (CSS length) of list marker bullets (disc/circle/square)
305 +$this->list_symbol_size = '3.6pt'; // Size (CSS) of list marker bullets (disc/circle/square)
306 +
307 +// ACTIVE FORMS
308 +$this->useActiveForms = false;
309 +
310 +// WATERMARKS
311 +$this->watermarkImgBehind = false;
312 +$this->showWatermarkText = 0;
313 +$this->showWatermarkImage = 0;
314 +$this->watermarkText = '';
315 +$this->watermarkImage = '';
316 +$this->watermark_font = '';
317 +$this->watermarkTextAlpha = 0.2;
318 +$this->watermarkImageAlpha = 0.2;
319 +$this->watermarkImgAlphaBlend = 'Normal';
320 +// Accepts any PDF spec. value: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn,
321 +// HardLight, SoftLight, Difference, Exclusion
322 +// "Multiply" works well for watermark image on top
323 +
324 +// BORDERS
325 +$this->autoPadding = false; // Automatically increases padding in block elements when border-radius set - if required
326 +
327 +
328 +//////////////////////////////////////////////
329 +
330 +// Default values if no style sheet offered (cf. http://www.w3.org/TR/CSS21/sample.html)
331 +$this->defaultCSS = array(
332 + 'BODY' => array(
333 + 'FONT-FAMILY' => 'serif',
334 + 'FONT-SIZE' => '11pt',
335 + 'TEXT-INDENT' => '0pt',
336 + 'LINE-HEIGHT' => 'normal',
337 + 'MARGIN-COLLAPSE' => 'collapse', /* Custom property to collapse top/bottom margins at top/bottom of page - ignored in tables/lists */
338 + 'HYPHENS' => 'manual', /* mPDF 5.6.08 */
339 + 'FONT-KERNING' => 'auto', /* mPDF 6 */
340 + ),
341 + 'P' => array(
342 + 'MARGIN' => '1.12em 0',
343 + ),
344 + 'H1' => array(
345 + 'FONT-SIZE' => '2em',
346 + 'FONT-WEIGHT' => 'bold',
347 + 'MARGIN' => '0.67em 0',
348 + 'PAGE-BREAK-AFTER' => 'avoid',
349 + ),
350 + 'H2' => array(
351 + 'FONT-SIZE' => '1.5em',
352 + 'FONT-WEIGHT' => 'bold',
353 + 'MARGIN' => '0.75em 0',
354 + 'PAGE-BREAK-AFTER' => 'avoid',
355 + ),
356 + 'H3' => array(
357 + 'FONT-SIZE' => '1.17em',
358 + 'FONT-WEIGHT' => 'bold',
359 + 'MARGIN' => '0.83em 0',
360 + 'PAGE-BREAK-AFTER' => 'avoid',
361 + ),
362 + 'H4' => array(
363 + 'FONT-WEIGHT' => 'bold',
364 + 'MARGIN' => '1.12em 0',
365 + 'PAGE-BREAK-AFTER' => 'avoid',
366 + ),
367 + 'H5' => array(
368 + 'FONT-SIZE' => '0.83em',
369 + 'FONT-WEIGHT' => 'bold',
370 + 'MARGIN' => '1.5em 0',
371 + 'PAGE-BREAK-AFTER' => 'avoid',
372 + ),
373 + 'H6' => array(
374 + 'FONT-SIZE' => '0.75em',
375 + 'FONT-WEIGHT' => 'bold',
376 + 'MARGIN' => '1.67em 0',
377 + 'PAGE-BREAK-AFTER' => 'avoid',
378 + ),
379 + 'HR' => array(
380 + 'COLOR' => '#888888',
381 + 'TEXT-ALIGN' => 'center',
382 + 'WIDTH' => '100%',
383 + 'HEIGHT' => '0.2mm',
384 + 'MARGIN-TOP' => '0.83em',
385 + 'MARGIN-BOTTOM' => '0.83em',
386 + ),
387 + 'PRE' => array(
388 + 'MARGIN' => '0.83em 0',
389 + 'FONT-FAMILY' => 'monospace',
390 + ),
391 + 'S' => array(
392 + 'TEXT-DECORATION' => 'line-through',
393 + ),
394 + 'STRIKE' => array(
395 + 'TEXT-DECORATION' => 'line-through',
396 + ),
397 + 'DEL' => array(
398 + 'TEXT-DECORATION' => 'line-through',
399 + ),
400 + 'SUB' => array(
401 + 'VERTICAL-ALIGN' => 'sub',
402 + 'FONT-SIZE' => '55%', /* Recommended 0.83em */
403 + ),
404 + 'SUP' => array(
405 + 'VERTICAL-ALIGN' => 'super',
406 + 'FONT-SIZE' => '55%', /* Recommended 0.83em */
407 + ),
408 + 'U' => array(
409 + 'TEXT-DECORATION' => 'underline',
410 + ),
411 + 'INS' => array(
412 + 'TEXT-DECORATION' => 'underline',
413 + ),
414 + 'B' => array(
415 + 'FONT-WEIGHT' => 'bold',
416 + ),
417 + 'STRONG' => array(
418 + 'FONT-WEIGHT' => 'bold',
419 + ),
420 + 'I' => array(
421 + 'FONT-STYLE' => 'italic',
422 + ),
423 + 'CITE' => array(
424 + 'FONT-STYLE' => 'italic',
425 + ),
426 + 'Q' => array(
427 + 'FONT-STYLE' => 'italic',
428 + ),
429 + 'EM' => array(
430 + 'FONT-STYLE' => 'italic',
431 + ),
432 + 'VAR' => array(
433 + 'FONT-STYLE' => 'italic',
434 + ),
435 + 'SAMP' => array(
436 + 'FONT-FAMILY' => 'monospace',
437 + ),
438 + 'CODE' => array(
439 + 'FONT-FAMILY' => 'monospace',
440 + ),
441 + 'KBD' => array(
442 + 'FONT-FAMILY' => 'monospace',
443 + ),
444 + 'TT' => array(
445 + 'FONT-FAMILY' => 'monospace',
446 + ),
447 + 'SMALL' => array(
448 + 'FONT-SIZE' => '83%',
449 + ),
450 + 'BIG' => array(
451 + 'FONT-SIZE' => '117%',
452 + ),
453 + 'ACRONYM' => array(
454 + 'FONT-SIZE' => '77%',
455 + 'FONT-WEIGHT' => 'bold',
456 + ),
457 + 'ADDRESS' => array(
458 + 'FONT-STYLE' => 'italic',
459 + ),
460 + 'BLOCKQUOTE' => array(
461 + 'MARGIN-LEFT' => '40px',
462 + 'MARGIN-RIGHT' => '40px',
463 + 'MARGIN-TOP' => '1.12em',
464 + 'MARGIN-BOTTOM' => '1.12em',
465 + ),
466 + 'A' => array(
467 + 'COLOR' => '#0000FF',
468 + 'TEXT-DECORATION' => 'underline',
469 + ),
470 + 'UL' => array(
471 + 'PADDING' => '0 auto', /* mPDF 6 */
472 + 'MARGIN-TOP' => '0.83em', /* mPDF 6 */
473 + 'MARGIN-BOTTOM' => '0.83em', /* mPDF 6 */
474 + ),
475 + 'OL' => array(
476 + 'PADDING' => '0 auto', /* mPDF 6 */
477 + 'MARGIN-TOP' => '0.83em', /* mPDF 6 */
478 + 'MARGIN-BOTTOM' => '0.83em', /* mPDF 6 */
479 + ),
480 + 'DL' => array(
481 + 'MARGIN' => '1.67em 0',
482 + ),
483 + 'DT' => array(
484 + ),
485 + 'DD' => array(
486 + 'PADDING-LEFT' => '40px',
487 + ),
488 + 'TABLE' => array(
489 + 'MARGIN' => '0',
490 + 'BORDER-COLLAPSE' => 'separate',
491 + 'BORDER-SPACING' => '2px',
492 + 'EMPTY-CELLS' => 'show',
493 + 'LINE-HEIGHT' => '1.2',
494 + 'VERTICAL-ALIGN' => 'middle',
495 + 'HYPHENS' => 'manual', /* mPDF 6 */
496 + 'FONT-KERNING' => 'auto', /* mPDF 6 */
497 + ),
498 + 'THEAD' => array(
499 + ),
500 + 'TFOOT' => array(
501 + ),
502 + 'TH' => array(
503 + 'FONT-WEIGHT' => 'bold',
504 + 'TEXT-ALIGN' => 'center',
505 + 'PADDING-LEFT' => '0.1em',
506 + 'PADDING-RIGHT' => '0.1em',
507 + 'PADDING-TOP' => '0.1em',
508 + 'PADDING-BOTTOM' => '0.1em',
509 + ),
510 + 'TD' => array(
511 + 'PADDING-LEFT' => '0.1em',
512 + 'PADDING-RIGHT' => '0.1em',
513 + 'PADDING-TOP' => '0.1em',
514 + 'PADDING-BOTTOM' => '0.1em',
515 + ),
516 + 'CAPTION' => array(
517 + 'TEXT-ALIGN' => 'center',
518 + ),
519 + 'IMG' => array(
520 + 'MARGIN' => '0',
521 + 'VERTICAL-ALIGN' => 'baseline',
522 + 'IMAGE-RENDERING' => 'auto',
523 + ),
524 + 'INPUT' => array(
525 + 'FONT-FAMILY' => 'sans-serif',
526 + 'VERTICAL-ALIGN' => 'middle',
527 + 'FONT-SIZE' => '0.9em',
528 + ),
529 + 'SELECT' => array(
530 + 'FONT-FAMILY' => 'sans-serif',
531 + 'FONT-SIZE' => '0.9em',
532 + 'VERTICAL-ALIGN' => 'middle',
533 + ),
534 + 'TEXTAREA' => array(
535 + 'FONT-FAMILY' => 'monospace',
536 + 'FONT-SIZE' => '0.9em',
537 + 'VERTICAL-ALIGN' => 'text-bottom',
538 + ),
539 + 'MARK' => array(/* mPDF 5.5.09 */
540 + 'BACKGROUND-COLOR' => 'yellow',
541 + ),
542 +);
543 +
544 +
545 +//////////////////////////////////////////////////
546 +// VALUES ONLY LIKELY TO BE CHANGED BY DEVELOPERS
547 +//////////////////////////////////////////////////
548 +$this->pdf_version = '1.4';
549 +
550 +// Hyphenation
551 +$this->SHYlanguages = array('en', 'de', 'es', 'fi', 'fr', 'it', 'nl', 'pl', 'ru', 'sv'); // existing defined patterns
552 +
553 +$this->default_lineheight_correction = 1.2; // Value 1 sets lineheight=fontsize height;
554 +// Value used if line-height not set by CSS (usually is)
555 +
556 +$this->fontsizes = array('XX-SMALL' => 0.7, 'X-SMALL' => 0.77, 'SMALL' => 0.86, 'MEDIUM' => 1, 'LARGE' => 1.2, 'X-LARGE' => 1.5, 'XX-LARGE' => 2);
557 +
558 +// CHARACTER PATTERN MATCHES TO DETECT LANGUAGES
559 +// pattern used to detect RTL characters -> force RTL
560 +$this->pregRTLchars = "\x{0590}-\x{06FF}\x{0700}-\x{085F}\x{FB00}-\x{FDFD}\x{FE70}-\x{FEFF}"; // 085F to include Mandaic
561 +// Chars which distinguish CJK but not between different
562 +$this->pregCJKchars = "\x{1100}-\x{11FF}\x{2E80}-\x{A4CF}\x{A800}-\x{D7AF}\x{F900}-\x{FAFF}\x{FE30}-\x{FE6F}\x{FF00}-\x{FFEF}\x{20000}-\x{2FA1F}";
563 +
564 +// For CJK Line-breaking - References:
565 +// http://en.wikipedia.org/wiki/Line_breaking_rules_in_East_Asian_languages
566 +// http://msdn.microsoft.com/en-us/goglobal/bb688158.aspx - listed using charsets
567 +// Word wrapping in other langauges - http://msdn.microsoft.com/en-us/goglobal/bb688158.aspx
568 +// Word wrapping in Japanese/Korean - http://en.wikipedia.org/wiki/Kinsoku_shori
569 +// Unicode character types: http://unicode.org/reports/tr14/
570 +// http://xml.ascc.net/en/utf-8/faq/zhl10n-faq-xsl.html#qb1
571 +// ECMA-376 4th edition Part 1
572 +// http://www.ecma-international.org/publications/standards/Ecma-376.htm
573 +
574 +//Leading characters - Not allowed at end of line
575 +$this->CJKleading = "\$\(\*\[\{\x{00a3}\x{00a5}\x{00ab}\x{00b7}\x{2018}\x{201c}\x{2035}\x{3005}\x{3007}\x{3008}\x{300a}\x{300c}\x{300e}\x{3010}\x{3014}\x{3016}\x{3018}\x{301d}\x{fe34}\x{fe35}\x{fe37}\x{fe39}\x{fe3b}\x{fe3d}\x{fe3f}\x{fe41}\x{fe43}\x{fe57}\x{fe59}\x{fe5b}\x{fe5d}\x{ff04}\x{ff08}\x{ff0e}\x{ff3b}\x{ff5b}\x{ff5f}\x{ff62}\x{ffe1}\x{ffe5}\x{ffe6}";
576 +
577 +// Following characters - Not allowed at start
578 +$this->CJKfollowing = "!%\),\.:;>\?\]\}\x{00a2}\x{00a8}\x{00b0}\x{00b7}\x{00bb}\x{02c7}\x{02c9}\x{2010}\x{2013}-\x{2016}\x{2019}\x{201d}-\x{201f}\x{2020}-\x{2022}\x{2025}-\x{2027}\x{2030}\x{2032}\x{2033}\x{203a}\x{203c}\x{2047}-\x{2049}\x{2103}\x{2236}\x{2574}\x{3001}-\x{3003}\x{3005}\x{3006}\x{3009}\x{300b}\x{300d}\x{300f}\x{3011}\x{3015}\x{3017}\x{3019}\x{301c}\x{301e}\x{301f}\x{303b}\x{3041}\x{3043}\x{3045}\x{3047}\x{3049}\x{3063}\x{3083}\x{3085}\x{3087}\x{308e}\x{3095}\x{3096}\x{309b}-\x{309e}\x{30a0}\x{30a1}\x{30a3}\x{30a5}\x{30a7}\x{30a9}\x{30c3}\x{30e3}\x{30e5}\x{30e7}\x{30ee}\x{30f5}\x{30f6}\x{30fb}-\x{30fd}\x{30fe}\x{31f0}-\x{31ff}\x{fe30}\x{fe31}-\x{fe34}\x{fe36}\x{fe38}\x{fe3a}\x{fe3c}\x{fe3e}\x{fe40}\x{fe42}\x{fe44}\x{fe4f}\x{fe50}-\x{fe58}\x{fe5a}\x{fe5c}-\x{fe5e}\x{ff01}\x{ff02}\x{ff05}\x{ff07}\x{ff09}\x{ff0c}\x{ff0e}\x{ff1a}\x{ff1b}\x{ff1f}\x{ff3d}\x{ff40}\x{ff5c}-\x{ff5e}\x{ff60}\x{ff61}\x{ff63}-\x{ff65}\x{ff9e}\x{ff9f}\x{ffe0}";
579 +
580 +// Characters which are allowed to overflow the right margin (from CSS3 http://www.w3.org/TR/2012/WD-css3-text-20120814/#hanging-punctuation)
581 +$this->CJKoverflow = "\.,\x{ff61}\x{ff64}\x{3001}\x{3002}\x{fe50}-\x{fe52}\x{ff0c}\x{ff0e}";
582 +
583 +// mPDF 6
584 +// Used for preventing letter-spacing in cursive scripts
585 +// NB The following scripts in Unicode 6 are considered to be cursive scripts,
586 +// and do not allow expansion opportunities between their letters:
587 +// Arabic, Syriac, Mandaic, Mongolian, N'Ko, Phags Pa
588 +$this->pregCURSchars = "\x{0590}-\x{083E}\x{0900}-\x{0DFF}\x{FB00}-\x{FDFD}\x{FE70}-\x{FEFF}";
589 +
590 +
591 +$this->allowedCSStags = 'DIV|P|H1|H2|H3|H4|H5|H6|FORM|IMG|A|BODY|TABLE|HR|THEAD|TFOOT|TBODY|TH|TR|TD|UL|OL|LI|PRE|BLOCKQUOTE|ADDRESS|DL|DT|DD';
592 +$this->allowedCSStags .= '|ARTICLE|ASIDE|FIGURE|FIGCAPTION|FOOTER|HEADER|HGROUP|NAV|SECTION|MAIN|MARK|DETAILS|SUMMARY|METER|PROGRESS|TIME';
593 +$this->allowedCSStags .= '|SPAN|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|STRIKE|S|U|DEL|INS|Q|FONT';
594 +$this->allowedCSStags .= '|SELECT|INPUT|TEXTAREA|CAPTION|FIELDSET|LEGEND';
595 +$this->allowedCSStags .= '|TEXTCIRCLE|DOTTAB|BDO|BDI';
596 +
597 +$this->outerblocktags = array('DIV', 'FORM', 'CENTER', 'DL', 'FIELDSET', 'ARTICLE', 'ASIDE', 'FIGURE', 'FIGCAPTION', 'FOOTER', 'HEADER', 'HGROUP', 'MAIN', 'NAV', 'SECTION', 'DETAILS', 'SUMMARY', 'UL', 'OL', 'LI');
598 +$this->innerblocktags = array('P', 'BLOCKQUOTE', 'ADDRESS', 'PRE', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'DT', 'DD', 'CAPTION');