Results 1 to 2 of 2

Thread: Sugarpdf writeHTML ignores <style> definitions

  1. #1
    mminnie's Avatar
    mminnie is offline Sugar Community Member
    Join Date
    May 2005
    Location
    Sacramento, CA
    Posts
    97

    Default Sugarpdf writeHTML ignores <style> definitions

    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:

    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($htmltruefalsetruefalse'');


    The style definitions are written as text to the PDF. Any ideas as to why?


    If I'm stubborn enough, I just might figure it out myself.
    SugarCRM Version 6.5.9 (Build 8653)
    System: Linux 3.2.0-32-generic Ubuntu 12.04 LTS
    PHP Version 5.3.10-1ubuntu3.4
    MySQL Version 5.5.24

  2. #2
    mminnie's Avatar
    mminnie is offline Sugar Community Member
    Join Date
    May 2005
    Location
    Sacramento, CA
    Posts
    97

    Default Re: Sugarpdf writeHTML ignores <style> definitions

    I'm guessing this is the problem:

    PHP Code:
    //============================================================+
    // File name   : tcpdf.php
    // Begin       : 2002-08-03
    // Last Update : 2009-05-28
    // Author      : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
    // Version     : 4.6.013
    // License     : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
    //      ------------------------------------------------------------------- 
    Version 4.6.013. 4 years old! CSS wasn't handle well (or at all?) in that version.


    If I'm stubborn enough, I just might figure it out myself.
    SugarCRM Version 6.5.9 (Build 8653)
    System: Linux 3.2.0-32-generic Ubuntu 12.04 LTS
    PHP Version 5.3.10-1ubuntu3.4
    MySQL Version 5.5.24

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 2012-07-09, 05:25 PM
  2. CSS in SugarPDF
    By mccon1 in forum Developer Help
    Replies: 1
    Last Post: 2011-04-03, 03:54 PM
  3. Developer Guide SugarPDF question
    By pietergildenhuys in forum Developer Help
    Replies: 0
    Last Post: 2010-05-17, 01:40 PM
  4. Saving a bean ignores certain fields
    By affinity4 in forum Help
    Replies: 0
    Last Post: 2008-07-08, 02:29 PM
  5. Replies: 0
    Last Post: 2005-10-19, 11:32 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •