Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am using MPDF and need to reduce the font size in tables for normal text -although find on screen, it's too big in reports.
I was able to reduce the font size globally by adding a line into sites/all/libraries/mpdf/mpdf.css
td {font-size:8pt;}
However, as this is global, is there a way to change CSS on a per report basis?
MPDF documentation indicates custom CSS is possible, but still appears global
http://mpdf1.com/manual/index.php?tid=254
Looks like we can specify custom css in config.php, but again I can't see how to make this report specific.
Let me know if you can help.
Thanks.
Comments
Comment #1
metzlerd CreditAttribution: metzlerd commentedThere are lots of ways to do this. First if you just want some custom css in a particular report, your .frx files can support
tags in the report. If you want it only to be for one report, and only applied for the pdf transform, and the report frx file is named foo.frx then you can create a foo-pdf.css file in the same directory that would only apply to the PDF transformation for the foo report. Likewise a foo.css file created in the same directory as the reports also applies to both screen and PDF and print media. Alternatively, you can create pdf-only css libraries and have them apply only to the PDF transform to your skin by placing the following in your .skinfo filestylesheets[pdf][] = mypdflibrary.css.
These libraries then would only apply to PDF transform for reports that used that skin. Different .skinfo files may be created for different collections of reports. Of course with forena it's easy to class your divs and create css that only applies when used in a particular report. Well that's probably way too much info, and more can be found in the Skins and Theming section of the documentation. Let me know if you have trouble getting any of these techniques to work.
Comment #2
MickC CreditAttribution: MickC commentedThe foo.css method worked like a charm!
I see this in the documentation referring to pdf stylesheets, but I didn't pick up that you can simply make a per report stylesheet - makes things easy.
Resolved - many thanks.