123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401 |
- <?php
- PHP_VERSION >= 5.0 or die("DOMPDF requires PHP 5.0+");
- define("DOMPDF_DIR", str_replace(DIRECTORY_SEPARATOR, '/', realpath(dirname(__FILE__))));
- define("DOMPDF_INC_DIR", DOMPDF_DIR . "/include");
- define("DOMPDF_LIB_DIR", DOMPDF_DIR . "/lib");
- if( !isset($_SERVER['DOCUMENT_ROOT']) ) {
- $path = "";
-
- if ( isset($_SERVER['SCRIPT_FILENAME']) )
- $path = $_SERVER['SCRIPT_FILENAME'];
- elseif ( isset($_SERVER['PATH_TRANSLATED']) )
- $path = str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']);
-
- $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($path, 0, 0-strlen($_SERVER['PHP_SELF'])));
- }
- if ( file_exists(DOMPDF_DIR . "/dompdf_config.custom.inc.php") ){
- require_once(DOMPDF_DIR . "/dompdf_config.custom.inc.php");
- }
- require_once(DOMPDF_INC_DIR . "/functions.inc.php");
- def("DOMPDF_ADMIN_USERNAME", "user");
- def("DOMPDF_ADMIN_PASSWORD", "password");
- def("DOMPDF_FONT_DIR", DOMPDF_DIR . "/lib/fonts/");
- def("DOMPDF_FONT_CACHE", DOMPDF_FONT_DIR);
- def("DOMPDF_TEMP_DIR", sys_get_temp_dir());
- def("DOMPDF_CHROOT", realpath(DOMPDF_DIR));
- def("DOMPDF_UNICODE_ENABLED", true);
- def("DOMPDF_ENABLE_FONTSUBSETTING", false);
- def("DOMPDF_PDF_BACKEND", "CPDF");
- def("DOMPDF_DEFAULT_MEDIA_TYPE", "screen");
- def("DOMPDF_DEFAULT_PAPER_SIZE", "letter");
- def("DOMPDF_DEFAULT_FONT", "serif");
- def("DOMPDF_DPI", 96);
- def("DOMPDF_ENABLE_PHP", false);
- def("DOMPDF_ENABLE_JAVASCRIPT", true);
- def("DOMPDF_ENABLE_REMOTE", false);
- def("DOMPDF_LOG_OUTPUT_FILE", DOMPDF_FONT_DIR."log.htm");
- def("DOMPDF_FONT_HEIGHT_RATIO", 1.1);
- def("DOMPDF_ENABLE_CSS_FLOAT", false);
- def("DOMPDF_AUTOLOAD_PREPEND", false);
- def("DOMPDF_ENABLE_HTML5PARSER", false);
- require_once(DOMPDF_LIB_DIR . "/html5lib/Parser.php");
- if (!class_exists("ComposerAutoloaderInit")) {
- if (file_exists(DOMPDF_DIR . "/vendor/autoload.php")) {
-
- require_once(DOMPDF_DIR . "/vendor/autoload.php");
- } else {
-
- require_once(DOMPDF_INC_DIR . "/autoload.inc.php");
- }
- }
- if (!class_exists('Font')) {
- if (file_exists(DOMPDF_LIB_DIR . "/php-font-lib/classes/font.cls.php")) {
- require_once(DOMPDF_LIB_DIR . "/php-font-lib/classes/font.cls.php");
- } else {
- exit("PHP-font-lib must either be installed via composer or copied to lib/php-font-lib\n");
- }
- }
- mb_internal_encoding('UTF-8');
- global $_dompdf_warnings;
- $_dompdf_warnings = array();
- global $_dompdf_show_warnings;
- $_dompdf_show_warnings = false;
- global $_dompdf_debug;
- $_dompdf_debug = false;
- global $_DOMPDF_DEBUG_TYPES;
- $_DOMPDF_DEBUG_TYPES = array();
- def('DEBUGPNG', false);
- def('DEBUGKEEPTEMP', false);
- def('DEBUGCSS', false);
- def('DEBUG_LAYOUT', false);
- def('DEBUG_LAYOUT_LINES', true);
- def('DEBUG_LAYOUT_BLOCKS', true);
- def('DEBUG_LAYOUT_INLINE', true);
- def('DEBUG_LAYOUT_PADDINGBOX', true);
|