Oct 112010
 

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)

libraries/joomla/document/pdf/pdf.php

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

libraries/tcpdf/tcpdf.php

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.

components/com_content/views/article/view.pdf.php

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>';
echo $article->text;

There you go!

Mar 132010
 

While Joomla 1.5 in general supports many good SEO features, most templates will only display the name of the site in the <title> tag on the homepage, and will use article names as the page title everywhere else. This can produce undesired results when displaying your site’s links on a google search page, for example.

Ercan Özkaya provides a free Joomla 1.5 plugin that will allow you to insert a customized site name into the <title> tag for all of your pages. It works great and solves the problem with ease.

Before: Contact Us

After: guyzero.com | Contact Us       or      guyzero.com’s blog | Contact Us

Download