1<?php
2// $Header: /cvsroot/html2ps/config.inc.php,v 1.50 2007/05/17 13:55:13 Konstantin Exp $
3
4/**
5 * Common configuration options
6 */
7
8// Directory containing HTML2PS script files (with traling slash)
9if (!defined('HTML2PS_DIR')) {
10  define('HTML2PS_DIR', dirname(__FILE__).DIRECTORY_SEPARATOR);
11};
12
13// User-Agent HTTP header to send when requesting a file
14define('DEFAULT_USER_AGENT',"Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7) Gecko/20040803 Firefox/0.9.3");
15
16// Default PDF or PS file name to use
17define('OUTPUT_DEFAULT_NAME','unnamed');
18
19// Default text encoding to use when no encoding information is available
20define('DEFAULT_ENCODING', 'utf-8');
21//define('DEFAULT_ENCODING', 'iso-8859-1');
22
23/**
24 * Postscript-specific configuration options
25 */
26
27// Path to Ghostscript executable
28define('GS_PATH','/usr/bin/gs');
29
30// Path to font metric files (AFM files).
31// NOTE: Trailing backslash required
32define('TYPE1_FONTS_REPOSITORY', "/usr/share/fonts/default/ghostscript/");
33// define('TYPE1_FONTS_REPOSITORY',"/usr/share/ghostscript/fonts/");
34
35/**
36 * PDFLIB-specific configuration options
37 */
38
39// Path to PDFLIB dynamically loaded library (if not configured in php.ini to load automatically)
40define('PDFLIB_DL_PATH','/usr/lib64/pdflib.so');
41
42// Uncomment this if you have PDFLIB license key and want to use it
43// define('PDFLIB_LICENSE', 'YOUR LICENSE KEY');
44
45// This variable defines the path to PDFLIB configuration file; in particular, it contains
46// information about the supported encodings.
47//
48// define('PDFLIB_UPR_PATH',"c:/php/php4.4.0/pdf-related/pdflib.upr");
49// define('PDFLIB_UPR_PATH',"c:/php/pdf-related/pdflib.upr");
50
51// Path to directory containing fonts used by PDFLIB / FPDF
52// Trailing backslash required
53define('TTF_FONTS_REPOSITORY',HTML2PS_DIR."fonts/");
54
55// Determines how font files are embedded. May be:
56// 'all' - embed all fonts
57// 'none' - do not embed any fonts
58// 'config' - whether font is embedded is determined by html2ps.config 'embed' attribute value for this font
59define('FONT_EMBEDDING_MODE', 'config');
60
61/**
62 * Some constants you better not change.
63 *
64 * They're created in order to avoid using too much "magic numbers" in the script source,
65 * but it is very unlikely you'll need to change them
66 */
67
68define('EPSILON',0.001);
69define('DEFAULT_SUBMIT_TEXT','Submit');
70define('DEFAULT_RESET_TEXT' ,'Reset');
71define('DEFAULT_BUTTON_TEXT','Send request');
72define('CHECKBOX_SIZE','15px');
73define('RADIOBUTTON_SIZE','15px');
74define('SELECT_BUTTON_TRIANGLE_PADDING',1.5);
75define('BROKEN_IMAGE_DEFAULT_SIZE_PX',24);
76define('BROKEN_IMAGE_ALT_SIZE_PT',10);
77define('BASE_FONT_SIZE_PT',12);
78define('DEFAULT_TEXT_SIZE',20);
79define('EM_KOEFF',1);
80
81// Note that Firefox calculated ex for each font separately, while
82// IE uses fixed value of 'ex' unit. We behave like IE here.
83define('EX_KOEFF',0.50);
84
85define('DEFAULT_CHAR_WIDTH', 600);
86define('WHITESPACE_FONT_SIZE_FRACTION', 0.25);
87define('SIZE_SPACE_KOEFF', 1.2);
88define('INPUT_SIZE_EM_KOEFF', 0.48);
89define('INPUT_SIZE_BASE_EM', 2.2);
90define('SELECT_SPACE_PADDING', 5);
91define('LEGEND_HORIZONTAL_OFFSET', '5pt');
92define('BULLET_SIZE_KOEFF', 0.15);
93define('HEIGHT_KOEFF', 0.7);
94define('MAX_FRAME_NESTING_LEVEL', 4);
95
96// Maximal value of the free  space in justified line; if there's more
97// free  space, line  will be  left-aligned to  avoid making  too much
98// space  between words (set  to 1  if all  lines should  be justified
99// regardless of free space)
100define('MAX_JUSTIFY_FRACTION', 0.33);
101
102define('HILIGHT_COLOR_ALPHA', 0.6);
103define('MAX_REDIRECTS', 5);
104
105// Maximal length of line inside the stream data
106// (we need to limit this, as most postscript interpreters will complain
107// on long strings)
108//
109// Note it is measured in BYTES! Each byte will be represented by TWO characters
110// in the hexadecimal form
111//
112define("MAX_LINE_LENGTH", 100);
113define('MAX_IMAGE_ROW_LEN',16);
114define('MAX_TRANSPARENT_IMAGE_ROW_LEN',16);
115
116define('CACHE_DIR', HTML2PS_DIR.'cache/');
117define('OUTPUT_FILE_DIRECTORY', HTML2PS_DIR.'out/');
118define('FPDF_PATH', HTML2PS_DIR.'fpdf/');
119
120// Trailing directory separator ('/' or '\', depending on your system)
121// SHOULD BE OMITTED
122define('WRITER_TEMPDIR', HTML2PS_DIR.'temp');
123define('WRITER_FILE_PREFIX','PS_');
124
125// number of retries to generate unique filename in case we have had troubles with
126// tempnam function
127define('WRITER_RETRIES',10);
128define('WRITER_CANNOT_CREATE_FILE',"Cannot create unique temporary filename, sorry");
129
130define('HTML2PS_CONNECTION_TIMEOUT', 10);
131
132// directory to restrict 'file://' access to
133// empty string for no restrictions
134define('FILE_PROTOCOL_RESTRICT', HTML2PS_DIR);
135
136define('FOOTNOTE_LINE_PERCENT', 30);
137define('FOOTNOTE_LINE_TOP_GAP', 1); // Content points
138define('FOOTNOTE_LINE_BOTTOM_GAP', 3); // Content points
139define('FOOTNOTE_MARKER_MARGIN', 1); // Content points
140define('FOOTNOTE_GAP', 2); // Space between footnotes
141
142if (!defined('DEBUG_MODE')) {
143  // define('DEBUG_MODE',1);
144};
145
146define('HTML2PS_VERSION_MAJOR', 2);
147define('HTML2PS_VERSION_MINOR', 0);
148define('HTML2PS_SUBVERSION', 43);
149
150define('MAX_UNPENALIZED_FREE_FRACTION', 0.25);
151define('MAX_FREE_FRACTION',             0.5);
152define('MAX_PAGE_BREAK_HEIGHT_PENALTY',  10000);
153define('MAX_PAGE_BREAK_PENALTY',       1000000);
154define('FORCED_PAGE_BREAK_BONUS',     -1000000);
155define('PAGE_BREAK_INSIDE_AVOID_PENALTY',  300);
156define('PAGE_BREAK_AFTER_AVOID_PENALTY',  5100);
157define('PAGE_BREAK_BEFORE_AVOID_PENALTY', 1100);
158define('PAGE_BREAK_ORPHANS_PENALTY',      1000);
159define('PAGE_BREAK_WIDOWS_PENALTY',       1000);
160define('PAGE_BREAK_LINE_PENALTY',            0);
161define('PAGE_BREAK_BORDER_PENALTY',        150);
162
163define('OVERLINE_POSITION', 1);
164define('UNDERLINE_POSITION', 0.1);
165define('LINE_THROUGH_POSITION', 0.4);
166
167?>
168