function pdf_using_mpdf_help in PDF using mPDF 8
Same name and namespace in other branches
- 7.2 pdf_using_mpdf.module \pdf_using_mpdf_help()
- 7 pdf_using_mpdf.module \pdf_using_mpdf_help()
Implements hook_help().
File
- ./
pdf_using_mpdf.module, line 13 - Generates PDF for given html.
Code
function pdf_using_mpdf_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match) {
$output = '';
$html = 'This module is used for converting an HTML of a page to PDF using ';
$html .= 'the mPDF PHP Library. This module allows you to generate the pdf ';
$html .= 'documents of any node:<p><strong> PDF creation ';
$html .= '( www.example.com/node/[nid]/pdf ) </strong></p><p> where nid is ';
$html .= 'the node id of a node. </p> By creating your own CSS file and/or ';
$html .= 'the node.tpl.php template files, it is possible to change the look ';
$html .= 'of the output page to suit your taste.For a more fine-grained ';
$html .= 'customization, it is possible to use a twig file named: <p><strong> ';
$html .= 'node--[node-type|node-id].twig.html </strong></p><p> located in the ';
$html .= 'active theme directory. </p><p> Where node-type and node-id are ';
$html .= 'Drupal node type (for example page, story, etc.) and node id (for ';
$html .= 'example 10) respectively. </p> <p>You must run <em>composer.json</em>';
$html .= 'file (provided with this module) to install the third-party tool ';
$html .= '- %mPDF - to generate PDF files </p><p> Please follow the ';
$html .= 'instructions in the README.txt file carefully. </p>';
$link = Url::fromUri('http://www.mpdf1.com/mpdf/index.php');
$link = Link::fromTextAndUrl('mPDF', $link)
->toString();
if ($route_name == 'help.page.pdf_using_mpdf') {
$output = t($html, [
'%mPDF' => $link,
]);
}
return $output;
}