Hi all,
On behalf of one of my clients, I recently sponsored a new module by RealityLoop http://drupal.org/project/pdf_archive.
The basic premise is that I wanted to create a PDF version of a node and attach it back onto that node in a filefield. PDF_Archive uses Rules to determine triggers & conditions, and provides a couple of actions to create and attach the PDF, using TCPDF as backend.
In my use case, the node is an email newsletter (simplenews) made up of a whole bunch of views (entity views attach). The news it contains is constantly changing, and the email newsletter that was sent once a week was working fine - but if someone wanted to see what was "in the newsletter 2 weeks ago" we had no "snapshot" of that. So this PDF Archive module captures the newsletter when created(or saved after editting), and then attaches to the Newsletter node for that week.
I then have a simple list view of the newsletter PDFs for previous weeks.
It is working great for my needs.
Someone else my find it useful :)
My question: Can anyone point me to any documentation/material/training on how to style/format the PDF from a tpl.php file? I have next to zero coding skills - I'm a business analyst and site builder. But the PDF_Archive module contains a tpl.php file that can be overidden - I think that what I should be doing is including inline styles in that tpl.php file. But I have no idea of the syntax.
The original tpl.php file looks like this:
<?php print $page_top; ?>
<?php print $page; ?>
<?php print $page_bottom; ?>
And I have tried putting inline css in a div wrapper around the $page, with no results,
<?php print $page_top; ?>
<div style="color:#004600;"<?php print $page; ?> </div>
<?php print $page_bottom; ?>
and I also tried to reference the TCPDF manual to try to use $pdf-> within the <?php> tags for the $page
<?php print $page_top; ?>
<?php
$pdf->setCellPaddings(5,5,5,5);
print $page;
?>
<?php print $page_bottom; ?>
but I'm obviously wrong, completely making it up and shooting in the dark.
If anyone has any suggestions, would be greatly appreciated.