CalcBuilder Forum

Customize pdf styling

User moon_1892 2014-12-04 22:55:31

Is there a way to fine-tune the styling/css of the pdf output without filling the layout with a bunch of inline styles?

Moonsoft support 2014-12-05 11:14:54

Hello,

PDF library is able to handle classes and import css files. By default, if you enable 'import boostrap' in your calculator, JOOMLA/modules/mod_calcbuilder/assets/css/default.css is imported, so you could add your classes there.
In order to add new css files, you can edit JOOMLA/components/com_calcbuilder/views/calcbuilder/tmpl/pdf.php file, copy any of the css import lines and create your own:

$stylesheet = file_get_contents ( JURI::base () . 'modules/mod_calcbuilder/assets/css/YOUROWN.css' );
$mpdf->WriteHTML ( $stylesheet, 1 );

placing them at line 34

Regards,

...
CalcBuilder

Create dynamic calculators

Buy now!
...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!