Commit 2c2f861e authored by jcnventura's avatar jcnventura

Coder fixes

parent 878b0a64
......@@ -99,7 +99,7 @@ function _print_pdf_dompdf_version($pdf_tool) {
if (!defined('DOMPDF_DIR')) {
return 'unknown';
}
else if (!defined('DOMPDF_CHROOT')) {
elseif (!defined('DOMPDF_CHROOT')) {
return '0.5.1';
}
elseif (!defined('DOMPDF_FONT_CACHE')) {
......
......@@ -31,9 +31,9 @@ function print_pdf_mpdf_requirements($phase) {
);
foreach (array('graph_cache', 'ttfontdata', 'tmp') as $dir) {
$directory = dirname($tool[1]) .'/'. $dir;
$directory = dirname($tool[1]) . '/' . $dir;
if (!is_dir($directory) || !is_writable($directory)) {
$requirements['print_pdf_tool_'. $dir] = array(
$requirements['print_pdf_tool_' . $dir] = array(
'title' => $t('mPDF library'),
'value' => $t('Non-writable permissions'),
'description' => $t('You must change the %libdir permissions to be writable, as %lib requires write-access to that directory.', array('%lib' => 'mPDF', '%libdir' => $directory)),
......
......@@ -32,7 +32,7 @@ function print_pdf_mpdf_print_pdf_generate($html, $meta, $filename = NULL) {
$mpdf->SetAuthor(strip_tags($meta['name']));
$mpdf->SetCreator(variable_get('site_name', 'Drupal'));
// Pulled from the HTML meta data
//$mpdf->SetTitle(html_entity_decode($meta['title'], ENT_QUOTES, 'UTF-8'));
// $mpdf->SetTitle(html_entity_decode($meta['title'], ENT_QUOTES, 'UTF-8'));
// $keys = implode(' ', explode("\n", trim(strip_tags($print['taxonomy']))));
// $mpdf->SetKeywords($keys);
......@@ -40,8 +40,8 @@ function print_pdf_mpdf_print_pdf_generate($html, $meta, $filename = NULL) {
// Encrypt the file and grant permissions to the user to copy and print
// No password is required to open the document
// Owner has full rights using the password "MyPassword"
//$mpdf->SetProtection(array('copy','print'), '', 'MyPassword');
$mpdf->SetProtection(array('copy','print','print-highres'), '', '');
// $mpdf->SetProtection(array('copy', 'print'), '', 'MyPassword');
$mpdf->SetProtection(array('copy', 'print', 'print-highres'), '', '');
$mpdf->WriteHTML($html);
......@@ -49,7 +49,7 @@ function print_pdf_mpdf_print_pdf_generate($html, $meta, $filename = NULL) {
ob_clean();
if ($filename) {
//Close and output PDF document
// Close and output PDF document
$output_dest = ($content_disposition == 2) ? 'D' : 'I';
$mpdf->Output($filename, $output_dest);
return TRUE;
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains the administrative functions of the print_pdf_wkhtmltopdf sub-module.
* Contains the administrative functions of the print_pdf_wkhtmltopdf module.
*
* This file is included by the print_pdf_wkhtmltopdf module, and includes the
* settings form.
......
......@@ -11,16 +11,16 @@
*/
/**
* Generate a PDF version of the provided HTML.
*
* Generate a PDF version of the provided HTML.
*
* @param string $html
* HTML content of the PDF
* @param array $meta
* Meta information to be used in the PDF
* - url: original URL
* - name: author's name
* - title: Page title
* - node: node object
* - title: Page title
* - node: node object
* @param string $filename
* (optional) Filename of the generated PDF
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment