View source
<?php
define('PRINT_PDF_DOMPDF_UNICODE_DEFAULT', 0);
define('PRINT_PDF_DOMPDF_FONT_SUBSETTING_DEFAULT', FALSE);
function print_pdf_dompdf_pdf_tool_info() {
return array(
'name' => 'dompdf',
'min_version' => '0.8.2',
'url' => 'https://github.com/dompdf/dompdf/releases/latest',
'expand_css' => FALSE,
'public_dirs' => array(
'fonts',
),
);
}
function print_pdf_dompdf_theme() {
return array(
'print_pdf_dompdf_footer' => array(
'variables' => array(
'html' => '',
),
'file' => 'print_pdf_dompdf.pages.inc',
),
);
}
function print_pdf_dompdf_menu() {
$items = array();
$items['admin/config/user-interface/print/pdf/dompdf'] = array(
'title' => 'dompdf',
'description' => 'Configure the dompdf options.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'print_pdf_dompdf_settings',
),
'access arguments' => array(
'administer print',
),
'type' => MENU_LOCAL_TASK,
'file' => 'print_pdf_dompdf.admin.inc',
);
return $items;
}
function print_pdf_dompdf_pdf_tool_version($pdf_tool) {
if (basename($pdf_tool) == 'Dompdf.php') {
$dompdf_base = dirname(dirname($pdf_tool));
$version_file = $dompdf_base . '/VERSION';
if (file_exists($version_file)) {
return file_get_contents($version_file);
}
elseif (basename(dirname($pdf_tool)) === 'src') {
return '0.7.0 beta 2';
}
elseif (basename(dirname($pdf_tool)) === 'Dompdf') {
return '0.7.0 beta 1';
}
}
else {
if (file_exists(DRUPAL_ROOT . '/' . $pdf_tool)) {
include_once DRUPAL_ROOT . '/' . $pdf_tool;
}
if (defined('DOMPDF_ENABLE_AUTOLOAD')) {
return '0.6.0, or higher';
}
elseif (defined('DOMPDF_ADMIN_USERNAME')) {
return '0.6.0 beta3';
}
elseif (defined('DOMPDF_LOG_OUTPUT_FILE')) {
return '0.6.0 beta2';
}
elseif (defined('DOMPDF_FONT_CACHE')) {
return '0.6.0 beta1';
}
elseif (defined('DOMPDF_CHROOT')) {
return '0.5.2';
}
elseif (defined('DOMPDF_DIR')) {
return '0.5.1';
}
}
return 'unknown';
}
function print_pdf_dompdf_print_pdf_available_libs_alter(&$pdf_tools) {
module_load_include('inc', 'print', 'includes/print');
$tools = _print_scan_libs('dompdf', '!^(dompdf_config.inc.php|Dompdf.php)$!');
foreach ($tools as $tool) {
if (basename($tool) == 'Dompdf.php') {
$pdf_tools['print_pdf_dompdf|' . $tool] = 'dompdf (' . dirname(dirname($tool)) . ')';
}
else {
$pdf_tools['print_pdf_dompdf|' . $tool] = 'dompdf (' . dirname($tool) . ')';
}
}
}