I copied a TCPDF example from http://www.tcpdf.org/examples/example_061.phps and tried to create this example PDF in Sugar. In Sugar, the PDF is created with the CSS styles written verbatim into the PDF. The CSS styles ARE NOT applied to the corresponding XHTML.
An example of what I'm using is:
The style definitions are written as text to the PDF. Any ideas as to why?PHP Code:
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('include/Sugarpdf/Sugarpdf.php');
class MyModuleSugarpdfTest extends Sugarpdf{
function display(){
$html = <<<EOF
<!-- EXAMPLE OF CSS STYLE -->
<style>
h1 {
color: navy;
font-family: times;
font-size: 24pt;
text-decoration: underline;
}
p.first {
color: #003300;
font-family: helvetica;
font-size: 12pt;
}
</style>
<h1>Hello World!</h1>
------- MORE HTML -------
EOF;
$this->writeHTML($html, true, false, true, false, '');
}


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks