--- print_pdf/print_pdf.admin.inc-org	2011-08-21 07:45:49.000000000 +0200
+++ print_pdf/print_pdf.admin.inc	2011-08-21 09:09:05.000000000 +0200
@@ -182,7 +182,7 @@
       '#type' => 'checkbox',
       '#title' => t('Auto-configure the PDF tool settings'),
       '#default_value' => variable_get('print_pdf_autoconfig', PRINT_PDF_AUTOCONFIG_DEFAULT),
-      '#description' => t('If you disable this option, the pdf tool settings must be configured manually. For TCDPF, edit the tcpdf/config/tcpdf_config.php file. For dompdf, edit the dompdf/dompdf_config.inc.php file.'),
+      '#description' => t('If you disable this option, the pdf tool settings must be configured manually. For TCDPF, edit the tcpdf/config/tcpdf_config.php file. For dompdf, edit the dompdf/dompdf_config.inc.php file. For mpdf, edit the mpdf/config.php file, currently no auto configure.'),
     );
     $form['settings']['print_pdf_font_family'] = array(
       '#type' => 'textfield',
@@ -280,13 +280,16 @@
  */
 function _print_pdf_tools() {
   $tools = array_keys(file_scan_directory(drupal_get_path('module', 'print'), '^dompdf_config.inc.php$'));
+  $tools = array_merge($tools, array_keys(file_scan_directory(drupal_get_path('module', 'print'), '^mpdf.php$')));
   $tools = array_merge($tools, array_keys(file_scan_directory(drupal_get_path('module', 'print'), '^tcpdf.php$')));
   $tools = array_merge($tools, array_keys(file_scan_directory(drupal_get_path('module', 'print'), '^wkhtmltopdf')));
   $tools = array_merge($tools, array_keys(file_scan_directory(PRINT_PDF_LIB_PATH, '^dompdf_config.inc.php$')));
+  $tools = array_merge($tools, array_keys(file_scan_directory(PRINT_PDF_LIB_PATH, '^mpdf.php$')));
   $tools = array_merge($tools, array_keys(file_scan_directory(PRINT_PDF_LIB_PATH, '^tcpdf.php$')));
   $tools = array_merge($tools, array_keys(file_scan_directory(PRINT_PDF_LIB_PATH, '^wkhtmltopdf')));
   if (module_exists('libraries')) {
     $tools = array_merge($tools, array_keys(file_scan_directory(libraries_get_path('dompdf'), '^dompdf_config.inc.php$')));
+    $tools = array_merge($tools, array_keys(file_scan_directory(libraries_get_path('mpdf'), '^mpdf.php$')));
     $tools = array_merge($tools, array_keys(file_scan_directory(libraries_get_path('tcpdf'), '^tcpdf.php$')));
     $tools = array_merge($tools, array_keys(file_scan_directory(libraries_get_path('wkhtmltopdf'), '^wkhtmltopdf')));
   }
--- print_pdf/print_pdf.module-org	2011-08-21 07:45:49.000000000 +0200
+++ print_pdf/print_pdf.module	2011-08-21 09:03:39.000000000 +0200
@@ -192,6 +192,19 @@
             );
           }
         }
+        elseif (basename($print_pdf_pdf_tool) == 'mpdf.php') {
+          foreach (array('graph_cache', 'ttfontdata', 'tmp') as $dir) {
+            $directory = dirname($print_pdf_pdf_tool) .'/'. $dir;
+            if (!is_dir($directory) || !is_writable($directory)) {
+              $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 mpdf requires write-access to that directory.', array('%libdir' => $directory)),
+                'severity' => REQUIREMENT_ERROR,
+              );
+            }
+          }
+        }
         elseif (basename($print_pdf_pdf_tool) == 'tcpdf.php') {
           $version = _print_pdf_tcpdf_version();
 
--- print_pdf/print_pdf.pages.inc-org	2011-08-21 07:45:49.000000000 +0200
+++ print_pdf/print_pdf.pages.inc	2011-08-21 09:20:25.000000000 +0200
@@ -17,6 +17,7 @@
  *
  * @see print_controller()
  * @see _print_pdf_dompdf()
+ * @see _print_pdf_mpdf()
  * @see _print_pdf_tcpdf()
  */
 function print_pdf_controller() {
@@ -99,6 +100,9 @@
   if (basename($print_pdf_pdf_tool) == 'dompdf_config.inc.php') {
     return _print_pdf_dompdf($print, $html, $filename);
   }
+  elseif (basename($print_pdf_pdf_tool) == 'mpdf.php') {
+    return _print_pdf_mpdf($print, $html, $filename);
+  }
   elseif (basename($print_pdf_pdf_tool) == 'tcpdf.php') {
     return _print_pdf_tcpdf($print, $html, $filename);
   }
@@ -240,6 +244,62 @@
 }
 
 /**
+ * Generate the PDF file using the mPDF library
+ *
+ * @param $print
+ *   array containing the configured data
+ * @param $html
+ *   contents of the post-processed template already with the node data
+ * @param $filename
+ *   name of the PDF file to be generated
+ * @see print_pdf_controller()
+ */
+function _print_pdf_mpdf($print, $html, $filename = NULL) {
+  $print_pdf_pdf_tool = variable_get('print_pdf_pdf_tool', PRINT_PDF_PDF_TOOL_DEFAULT);
+  $print_pdf_paper_size = variable_get('print_pdf_paper_size', PRINT_PDF_PAPER_SIZE_DEFAULT);
+  $print_pdf_page_orientation = variable_get('print_pdf_page_orientation', PRINT_PDF_PAGE_ORIENTATION_DEFAULT);
+  $print_pdf_content_disposition = variable_get('print_pdf_content_disposition', PRINT_PDF_CONTENT_DISPOSITION_DEFAULT);
+  require_once($print_pdf_pdf_tool);
+
+  $format = ($print_pdf_page_orientation == "landscape") ? $print_pdf_paper_size . "-L" : $print_pdf_paper_size;
+
+  // Try to use local file access for image files
+  $html = _print_pdf_file_access_images($html);
+
+  // set document information
+  $mpdf = new mPDF('UTF-8', $format);
+
+  $mpdf->SetAuthor(strip_tags($print['submitted']));
+  $mpdf->SetCreator(variable_get('site_name', 'Drupal'));
+  // Pulled from the HTML meta data
+  //$mpdf->SetTitle(html_entity_decode($print['title'], ENT_QUOTES, 'UTF-8'));
+
+  $keys = implode(' ', explode("\n", trim(strip_tags($print['taxonomy']))));
+  $mpdf->SetKeywords($keys);
+
+  // 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->WriteHTML($html);
+
+  // try to recover from any warning/error
+  ob_clean();
+
+  if ($filename) {
+    //Close and output PDF document
+    $output_dest = ($print_pdf_content_disposition == 2) ? 'D' : 'I';
+    $mpdf->Output($filename, $output_dest);
+    return TRUE;
+  }
+  else {
+    return $mpdf->Output('', 'S');
+  }
+}
+
+/**
  * Generate the PDF file using the TCPDF library
  *
  * @param $print
