Is it possible to theme the PDF from within the view?

I've tried to use CSS-classes to manipulate the table that is used by the orderlines, but without any luck sofar.
I'm not very familiar with TCPDF as i've used FDPF for most of the previous non-drupal stuff I had to do in the PDF-area.

It would be nice to have the option to show the table with borders, and have more control over the style of the table (change headers-color etc.)

Could someone point me into the right direction, or straight-out burst my bubble, stating that this is not possible? ;-)

Comments

maikeru’s picture

In regards to tables, TCPDF seems to have some support for theming borders/cell backgrounds.

Take a look at the views_pdf documentation:
http://drupal.org/node/1086584

In particular, theres a $border variable where you can set if a border is rendered or not on a cell.

Eg Under style settings in your view, change the Render settings for a fields "PHP Code Before Output: " to have:

$border = array('B' => array('width' => 1, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0)));

You'll get a red underline under the cell.

Heres some code for a pink cell background and red underline:

$border = array('B' => array('width' => 1, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0)));
$this->SetFillColor(0,255,0,0);
$fill = 1;