= 0.7.
if (version_compare($version, '1.2.1', '>')) {
$tool_path = dirname($pdf_tool[1]) . '/../../../../autoload.inc.php';
}
else {
$tool_path = dirname($pdf_tool[1]) . '/../autoload.inc.php';
}
if (file_exists($tool_path)) {
require_once $tool_path;
}
else {
watchdog('print_pdf', 'Configured PDF tool does not exist at path: %path', array('%path' => $tool_path), WATCHDOG_ERROR);
throw new Exception("Configured PDF tool does not exist, unable to generate PDF.");
}
$dompdf = new \Dompdf\Dompdf();
$unicode = TRUE;
if (variable_get('print_pdf_autoconfig', PRINT_PDF_AUTOCONFIG_DEFAULT)) {
$dompdf->set_option('enable_php', FALSE);
$dompdf->set_option('enable_remote', TRUE);
$dompdf->set_option('temp_dir', file_directory_temp());
$dompdf->set_option('enable_font_subsetting', $font_subsetting);
$dompdf->set_option('font_cache', drupal_realpath('public://print_pdf/print_pdf_dompdf/fonts/'));
}
}
// Allow third-party modules to alter the dompdf object.
drupal_alter('print_pdf_dompdf', $dompdf);
// Try to use local file access for image files.
$html = _print_access_images_via_file($html, $images_via_file);
// Remove all scripts due to security concerns.
$html = preg_replace('!!is', '', $html);
// Spaces in img URLs must be replaced with %20, when using external access.
if (!$images_via_file) {
$pattern = '!<(img\s[^>]*?)>!is';
$html = preg_replace_callback($pattern, '_print_replace_spaces', $html);
}
// It seems dompdf has problems with something in system.css, don't use it.
$html = preg_replace('!