Page 1 of 1

Change body font size for PDFs

Posted: 28 Aug 2009, 14:47
by BradC
In the TCPDF documentation it states that PDF_FONT_SIZE_MAIN controls the default main font size.

Although I tried changing all references to this, it made no difference to the body font size. Can you point me in the right direction (file)?

Re: Change body font size for PDFs

Posted: 28 Aug 2009, 18:15
by Jan
Hi, I think, this is a HTML so you need to set the font size in HTML, see:
administrator\components\com_phocamenu\helpers\phocamenurenderviews.php

and change the style of html tags or classes here:
line cca 863
//PDF
case 2:

e.g.
$tag['group-o'] = '<p style="font-weight:bold;font-size:x-large;">';
to:
$tag['group-o'] = '<p style="font-weight:bold;font-size:xxx-large;">';

or try to set pixels or pts

Jan

Re: Change body font size for PDFs

Posted: 29 Aug 2009, 14:45
by BradC
Thanks Jan

It took a bit of work, but I'm now reasonably happy with the PDF output. I had to use [np] to force page breaks on long menus.

Thanks again for all you help.

This is my code

Code: Select all

//PDF
case 2:

$tag['header-o']	= '<div style="font-size:11pt;">';
$tag['header-c']	= '</div>';
$tag['date-o']	= '';
$tag['date-c']	= '';
$tag['datesub-o']	= '';
$tag['datesub-c']	= '';
$tag['list-o']	= '';
$tag['list-c']	= '';
$tag['group-o']	= '<div style="font-weight:bold; font-size:14pt; color:#666666;">';
$tag['group-c']	= '</div>';

$tag['item-o']	= '<div>';
$tag['item-c']	= '</div>';
$tag['tableitem-c']	= '</table>';
$tag['message-o']	= '<div style="font-size:11pt;">';
$tag['message-c']	= '</div>';

$tag['image-o']	= '<td width="1pt">';
$tag['image-rs-o']	= '<td width="1pt" ';//Not closed - waiting for rowspan
$tag['image-c']	= '</td>';

if ($suffix == '-bl') {
	
	$tag['tableitem-o']	= '<table border="0" cellpadding="0" cellspacing="0">';
	
	$tag['groupleft-o']	= '<div style="font-weight:bold; font-size:14pt;">';
	$tag['groupleft-c']	= '';
	$tag['groupright-o']	= '';
	$tag['groupright-c']	= '</div>';
	
	$tag['quantity-o']	= '<td width="40pt" style="font-size:11pt;">';
	$tag['title-o']	= '<td width="431pt" style="font-weight:bold; font-size:11pt;">';
	$tag['priceprefix-o']	= '<td width="5pt" style="text-align:right; font-size:11pt;">';
	$tag['price-o']	= '<td width="50pt" style="text-align:right; font-size:11pt;">';
	
} else if($suffix == '-clm') {
	
	$tag['tableitem-o']	= '<table border="0" cellpadding="0" cellspacing="0">';
	
	$tag['quantity-o']	= '<td width="40pt" style="font-size:11pt;">';
	$tag['title-o']	= '<td width="431pt" style="font-weight:bold; font-size:11pt;">';
	$tag['priceprefix-o']	= '<td width="5pt" style="text-align:right; font-size:11pt;">';
	$tag['price-o']	= '<td width="50pt" style="text-align:right; font-size:11pt;">';

} else {
	
	$tag['tableitem-o']	= '<table border="0" cellpadding="0" cellspacing="0">';
	
	$tag['quantity-o']	= '<td width="40pt" style="font-size:11pt;">';
	$tag['title-o']	= '<td width="431pt" style="font-weight:bold; font-size:11pt;">';
	$tag['priceprefix-o']	= '<td width="5pt" style="text-align:right; font-size:11pt;">';
	$tag['price-o']	= '<td width="50pt" style="text-align:right; font-size:11pt;">';
}

$tag['quantity-c']	= '</td>';
$tag['title-c']	= '</td>';
$tag['priceprefix-c']	= '</td>';
$tag['price-c']	= '</td>';

$tag['desc-o']	= '<td width="431pt" style="font-style:italic; font-size:9pt;">';
$tag['desc-c']	= '</td>';

$tag['footer-o']	= '';
$tag['footer-c']	= '';
	
$tag['space']	= '';
$tag['spaceimg']	= '';

break;

Re: Change body font size for PDFs

Posted: 08 Sep 2009, 17:08
by Jan
Ok