vde_pdf_wkhtmltopdf_mpdf.module in Views Data Export PDF 7
Same filename and directory in other branches
Functions and hooks for the "Views Data Export PDF - Renderer: wkhtmltopdf and mPDF Hybrid" module.
File
modules/vde_pdf_wkhtmltopdf_mpdf/vde_pdf_wkhtmltopdf_mpdf.moduleView source
<?php
/**
* @file
* Functions and hooks for the
* "Views Data Export PDF - Renderer: wkhtmltopdf and mPDF Hybrid" module.
*/
/**
* Implements hook_pdf_export_renderers().
*/
function vde_pdf_wkhtmltopdf_mpdf_pdf_export_renderers() {
$renderers = [];
$renderers['wkhtmltopdf_mpdf_in_proc'] = [
'title' => t('wkhtmltopdf + mPDF Hybrid (In-process, blocking)'),
'description' => t('Invokes <code>wkhtmltopdf</code> to render the PDF, and mPDF to add headers and footers. Rendering happens within the request and blocks further processing of that request until the PDF has been finalized.'),
'class' => 'views_data_export_pdf_wkhtmltopdf_mpdf_in_proc_renderer',
'file' => 'src/views_data_export_pdf_wkhtmltopdf_mpdf_in_proc_renderer.inc',
];
if (module_exists('vde_pdf_background_process')) {
// This renderer wraps the in-proc renderer in a background process renderer
$renderers['wkhtmltopdf_mpdf_background_process'] = [
'title' => t('wkhtmltopdf + mPDF Hybrid (Background process, async)'),
'description' => t('Invokes <code>wkhtmltopdf</code> to render the PDF, and mPDF to add headers and footers. During batched exports, rendering happens in an asynchronous background process to avoid load balancer timeouts on large data sets.'),
'class' => 'views_data_export_pdf_background_process_renderer',
'file' => 'src/views_data_export_pdf_background_process_renderer.inc',
'file path' => drupal_get_path('module', 'vde_pdf_background_process'),
'constructor arguments' => [
'vde_pdf_wkhtmltopdf_mpdf',
'views_data_export_pdf_wkhtmltopdf_mpdf_in_proc_renderer',
],
];
}
return $renderers;
}
/**
* Gets the path of this module relative to the site base.
*
* @return string
*/
function vde_pdf_wkhtmltopdf_mpdf_get_module_path() {
return drupal_get_path('module', 'vde_pdf_wkhtmltopdf_mpdf');
}
Functions
Name![]() |
Description |
---|---|
vde_pdf_wkhtmltopdf_mpdf_get_module_path | Gets the path of this module relative to the site base. |
vde_pdf_wkhtmltopdf_mpdf_pdf_export_renderers | Implements hook_pdf_export_renderers(). |