CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions


Print topic Send  topic

Author Message

Posts: 56
Posted: 10/10/2008, 11:04 AM

Here's how I got DOMPDF to work within CCS - PHP, MySQL

Download the files from
I installed them in a folder on my server called 'dompdf' - minus the www folder with the example files.
In the 'dompdf' folder I created a folder called tmp and made it writable (chmod) - dompdf/tmp
Make the folder with the fonts writable also - dompdf/lib/fonts
In the code view of my page (not events) I put the require_once line in the white space under - //End Include Common Files

//End Include Common Files

In my HTML view of CCS I deleted all HTML, leaving nothing. Like an example I saw for FPDF on the CCS forums.

In beforeshow event of my page I have my code. The second code snippet below is not my actual code, but you should be able to get the idea.
I have my code in this way because I needed to have a few SQL WHILE loop queries happening.

You can get a simple result by just using a few lines like the example from digitaljunkies website:


 $html =    
    '<p>Some text</p>'.    
$dompdf = new DOMPDF();    
$dompdf->stream("my_pdf.pdf", array("Attachment" => 0));


This is the method I used to create my while loops.

$db = new clsDBconnection;  
$data = CCGetParam("data_id","");  
$SQL = "SELECT data_title, data_desc, data_img FROM data WHERE data_id =". $data;  
$datatitle = $db->f("data_title");  
$datadesc = $db->f("data_desc");  
$dataimg = $db->f("data_img");  
$strHtml = '<p><table cellspacing="0" cellpadding="5" width="90%" align="center" border="0">';  
$strHtml .= '<tr>';  
$strHtml .= '<td valign="top">';  
$strHtml .= '<strong>Data Title: '. $datatitle .'</strong><br>';  
$strHtml .= 'Description: '. $datadesc .'<br>';  
$strHtml .= '<td align="right" valign="top"><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/images/'. $dataimg .'"> </p></td>';  
$strHtml .= '</tr>';  
$strHtml .= '</table>';  
$strHtml .= '<table width="90%" border="0" align="center" cellpadding="5" cellspacing="0">';  
$strHtml .= '<tr>';  
$strHtml .= '</td>';  
$strHtml .= '<td valign="top"> </td>';  
$strHtml .= '</tr>';  
$strHtml .= '</table>';  
$strHtml .= '</body></html>';  
$dompdf = new DOMPDF();  
$dompdf->stream("brochure.pdf", array("Attachment" => 0)); // switch Attachment to 1 to view PDF in Acrobat.

Thats it. I will post if there is something I may have left out. Need to apply more fonts next.

Zye ...
View profile  Send private message

Posts: 942
Posted: 10/11/2008, 12:09 PM

Hey Zye

Thanks for this info and thanks for the post at

We are thinking of setting up scheduled chats over there and the DOMPDF subject came up. Hope you will join us for that discussion when we set it up.

Take Care..

See You Later
John Real - More CodeCharge Studio Support at -
View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

Internet Database

Visually create Web enabled database applications in minutes.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.