Waspman
Posts: 948
|
| Posted: 07/06/2009, 1:33 PM |
|
Just tried tcpdf and it is fabulous!!!
Being the sort of guy that likes thing simple, this is brilliant and it works first time.
Just thought it might save someone huntinng round...
T
_________________
http://www.waspmedia.co.uk |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 07/06/2009, 1:37 PM |
|
Cool That's great.
Here is another solution with all the code to do the transformation in CCS already written and installed.
It supports DOMPDF (with the security patch installed), PDFLib (PHP Extensions), and HTMLDOC ( a server side PDF Generator). Support for windows servers is also included.
This version also supports either temp file creation of the PDF or save a permanent copy if you want to save it and add to a database or other requirement.
http://ccselite.com/online_store.php?pid=24
Sample
Unconverted page: http://realtest.biz/PDF1/CCSPdfConvert.php
Converted Page: http://realtest.biz/PDF1/CCSPdfConvert.php?_convert=yes
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
Waspman
Posts: 948
|
| Posted: 07/06/2009, 2:45 PM |
|
Sorry John tried that first...err
It didn't work for me
_________________
http://www.waspmedia.co.uk |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 07/06/2009, 4:10 PM |
|
Wonder Why???
What was the problem??
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
Waspman
Posts: 948
|
| Posted: 07/07/2009, 3:11 AM |
|
Duno...followed all the instructions, but nothing happened?
tcpdf, worked first time no messing.
_________________
http://www.waspmedia.co.uk |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 07/07/2009, 4:21 AM |
|
Interesting,
I wonder what happened?? I have heard the reverse many times as well, frustration with tcpdf and dompdf was great. Also, I did not know tcpdf could take a HTML page as input. That's cool if it does.
Anyway, Glad you have a solution that works for you.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
Waspman
Posts: 948
|
| Posted: 07/07/2009, 8:55 AM |
|
Yes it does take HTML output from the CCS page and I added a background image, cos I used it for a variety of certificates.
Not tried it with anything really complicated yet.
_________________
http://www.waspmedia.co.uk |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 07/07/2009, 9:29 AM |
|
That;s cool
tcpdf did not used to,
Maybe put your immplementation together and sell it at CCSElite.com as an alternative.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
Waspman
Posts: 948
|
| Posted: 07/07/2009, 9:49 AM |
|
Nothing to sell...I didn't do anything? Just the - global $main_block; / $save_block = $main_block; - and put the $save_block in the WriteHTML code and it worked...Like I said I like things simple
_________________
http://www.waspmedia.co.uk |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 07/08/2009, 2:44 AM |
|
That is simple. LOL Pretty cool
tcpdf has come a long way
Was not that easy when I looked at tcpdf. (almost 2 yeras ago)
I am going to re-look at it.
Does tcpdf in this mode deal with all HTML tags??
Does tcpdf take care of the http:// headers and mime type configuration??
Thanks
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 07/08/2009, 2:54 AM |
|
BTW
If tcpdf is not setting headers for you you really should do something like this before you output the page.
$now = time();
$ServerDate = gmdate("D, d M Y H:i:s", $now) . " GMT";
$ExpireDate = gmdate("D, d M Y H:i:s", $now + 60) . " GMT";
Header("Cache-control: ");
Header("Pragma: ");
Header("Date: " . $ServerDate);
Header("Expires: " . $ExpireDate);
Header("Content-Type: application/pdf");
Just to keep the protocol or browesers from getting confused.
If you are putting save_block back into main_block, set this in before output.
If not all you need to do is set these headers before you echo save_block and exit.
But maybe tcpdf is doing all this for you which is cool.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
Waspman
Posts: 948
|
| Posted: 07/08/2009, 4:43 AM |
|
Thanks for this John
_________________
http://www.waspmedia.co.uk |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 07/08/2009, 5:37 AM |
|
Not a problem. Glad it works for you simply and in most cases that is the best.
However the issue of HTML to PDF conversion is not always that simple. And the level of simplicity is purely based on one's requirements.
One significant issue that not all HTML to PDF converters can cope with are style sheets or in-line styles. Also, font rendition can be an issue. Other tags and specifications can be a problem as well.
I do not know about tcpdf and if it can deal with all the HTML specifications and tags and accuruately convert the HTML. With what you discussed here, I am definitely going to take a look at tcpdf again.
DOMPDF, in it's pure php native mode, does not convert all HTML properly but does handle styles and fonts. I suspect tcpdf will have the same problems.
However, DOMPDF has the ability to use the PHP PDFlib extentions if installed. This gives a higher level of HTML to PDF conversion accuracy for all HTML tags and Specifications and uses the PHP PDFLib routines to perform the conversions.
CCSPdf ver. 2.3, http://ccselite.com/online_store.php?pid=24, does support DOMPDF using the PHP PDFlib extensions and in fact includes samples of those extensions, improving the PDF renedering from HTML by a significant factor.
Also, the next level of HTML to PDF conversion is a high performance, hi speed server side application that supports HTML specifications and tags 100% and creates the output many times faster and more efficiently than a PHP application can.
CCSPdf ver. 2.3, http://ccselite.com/online_store.php?pid=24, Supports the use of HTMLDOC which is such a server side application that is reasonably priced and performs very well on all unix/linix servers.
In fact, these demos are using CCSPdf ver, 2.3 implementing server side conversion with HTMLDOC.
Sample
Unconverted page: http://realtest.biz/PDF1/CCSPdfConvert.php
Converted Page: http://realtest.biz/PDF1/CCSPdfConvert.php?_convert=yes
So.. It all depends on one's requirements and I agree the simpler the better. But just sort of wanted to bring to light some of the other issues involved in HTML to PDF conversion.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
Waspman
Posts: 948
|
| Posted: 07/08/2009, 5:50 AM |
|
I did purchase your PDF converter as I said, so if tcpdf doesn't do what I want I'll come back to you and hopefully we can get it to work.
_________________
http://www.waspmedia.co.uk |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 07/08/2009, 5:59 AM |
|
No Prob. I don't think I ever got a email from you asking for support. But Certainly will support you if needed.
Simpler is always the best.
I will revisit tcpdf
But do consider the headers if you want to ensure compatibility and consistent functionality across the net.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |