Re: Webcapture to PDF
| From: | James E Hicks III | Date: | Thu, 13 May 2004 18:23:57 +0000 |
| Subject: | Re: Webcapture to PDF | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-186133@lists.php.net to get a copy of this message | ||
On Thursday 13 May 2004 11:59 am, Ashley M. Kirchner wrote:
> Looking for a (open source) solution here: is there some way that I
> can convert an already existing HTML page to a PDF file, by means of a
> script (on a unix box)? What I'd like to do is have a button on all of
> our pages that, when clicked on, will perform a capture of that page,
> including all images, convert to PDF, and serve it back to the user's
> browser. I don't just want what the user's viewing (I doubt that's
> possible anyway from a server-side point.) I want a full page capture,
> and then converted.
>
This is how I do it. (Warning this is psuedo-code!)
http://user.it.uu.se/~jan/html2ps.html
http://www.ps2pdf.com/convert/index.htm
<?php
system ("html2ps http://taget.system.com/target.html");
system ("ps2pdf target.ps");
echo ("<META HTTP-EQUIV=\"refresh\" content=\"1;
URL=target.pdf\">");
?>
James Hicks