You know, “click here for printable version” – but I want a downloadable document made from the same HTML content that a web page displays. Is there any utility out there, for example, that will convert HTML to a PDF, with valid hyperlinks?
The background on this, FWIW:
I am building a single-source communications database that includes communication content and other data, such as a relatively complex contacts DB, that is used for automating various tasks. All my content data is stored on a MySQL server, and I have ODBC-linked tables in a MS Access front end for manipulating data at the desktop level.
We manage the web data through this front end. Right now I have an Access report that we print to a PDF, to use for the downloadable file that goes with the web page. We do use some HTML tags in the content, and I have a VBA routine that strips out the tags for printing the Access report. But I don’t like the limitations of the Access report. The biggest issue right now is that I can’t figure out a way to make hyperlinks work in the PDF, from the Access report.
So I’m fishing for new ideas about how to offer a downloadable version of a (simple) web page, where the conversion will preserve hyperlinks…
You know, "click here for printable version" - but I want a downloadable document made from the same HTML content that a web page displays. Is there any utility out there, for example, that will convert HTML to a PDF, with valid hyperlinks?[/QUOTE]That doesn't make any sense at all. In my opinion the point of a pdf is it is for printing, and printed media doesn't have hyperlinks.
PDFs are not just for printable media.[/QUOTE]Well if that's what you believe maybe you should rush off to convert your site from HTML to PDF.
Well if that's what you believe maybe you should rush off to convert your site from HTML to PDF.[/QUOTE]
One approach:
http://www.mhanp.org/mclaughlin25.php
View the print preview.
If you like that, view the CSS for 'media print' rules.
Andy[/QUOTE]
[code=php]
$path = 'usrwwwuserswashing3privatedocuments'.$_GET["dest"];
require('/usr/www/users/washing3/cgi-bin/pdf/class.ezpdf.php');
$pdf = new Cezpdf();
$pdf->ezText($print); // I have loaded HTML into $print, to see what ezPDF does...
$pdfcode = $pdf->ezOutput();
$fp = fopen($path,'wb');
fwrite($fp,$pdfcode);
fclose($fp);
[/code]
"PDF is for printing" [/QUOTE]
Hey Aussie
or Steven --
I have put the ezpdf class in a directory and am trying to test it like this:
[code=php]
$path = 'usrwwwuserswashing3privatedocuments'.$_GET["dest"];
require('/usr/www/users/washing3/cgi-bin/pdf/class.ezpdf.php');
$pdf = new Cezpdf();
$pdf->ezText($print); // I have loaded HTML into $print, to see what ezPDF does...
$pdfcode = $pdf->ezOutput();
$fp = fopen($path,'wb');
fwrite($fp,$pdfcode);
fclose($fp);
[/code]
...and I'm getting an "unexpected T_string" error at the line with fopen() in it. the only other class I have downloaded and used is phpmailer. I don't remember if I had to do something to my php.ini file ... ?
The odd bit is that fopen() is just basic PHP, isn't it?
Can you see a goof in this code? Have I left out some important step?[/QUOTE]
But one other thing is worrying me - is HTML a file type that people's email software will allow?[/QUOTE]Yes it is but I would just send the html file as an attachment to the email; that way they will open it with a browser and not an email client (for maximum compatibility). Locate your CSS in the html file so it is a standalone and link to your images with full, absolute URIs.
0.1.9 — BETA 5.18