Phoca PDF is a great tool to use if you want to quickly add a custom header and footer to your PDFs. The component, the plugin, and your select font should all be installed, but installation is easy.
What didn’t quite work for me is that my requirement was to print the logo header only on the first page (rather than at the top of every page), and to have no footer. The other issue is that while Phoco had options to cache the generated PDFs, it appeared that they were always generated on-the-fly, and with much longer processing time before showing the PDF to the visitor than with default Joomla.
Rather than try to get Phoca to do what I needed (which would’ve been a bit more time consuming as Phoca is more complex), I made the following modifications to these Joomla files:
(line numbers are approximate)
Lines 33-47, adjust var $_margin_top and $_margin_bottom depending on the height of your logo
Line 211, comment out these lines:
// Set PDF Header data
// $pdf->setHeaderData(”,0,$this->getTitle(), $this->getHeader()); // this line prints the header on each page
line 561, set var $print_footer = false;
leave as true to get the default Joomla PDF footer,
setting var $print_header=false; will render blank PDFs, leave that value as true.
line 81, modify the code section to look like this:
// prepare header lines
// $document->setHeader($this->_getHeaderText($article, $params));
echo ‘<img src=”http://www.domainname.com/images/stories/printlogo.png” /><br /><br />';
echo ‘<h1>’ . $article->title . ‘</h1>';
There you go!