Re: PDF from PHP generated HTML, possible?

From: Date: Thu, 23 Sep 2004 15:41:07 +0000
Subject: Re: PDF from PHP generated HTML, possible?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-197707@lists.php.net to get a copy of this message
If you generated your HTML using a template engine (i.e. storing the page as one large string and then echo-ing that to screen), then you could write that to a file and run your conversion on that... HTH, Mikey ----- Original Message ----- From: "Graham Cossey" <graham@cossey.plus.com> Newsgroups: php.general To: "Php-General" <php-general@lists.php.net> Sent: Thursday, September 23, 2004 4:08 PM Subject: RE: [PHP] PDF from PHP generated HTML, possible? > > > Following the topic about generating PDF documents from within PHP has > > > prompted a thought... > > > > > > Is it possible to have PHP dynamically build an HTML page (from database > > > data etc) and provide an option to output the page as PDF without going > > > through all the database query routine again? > > > > > > In other words, to produce a PDF file from dynamic HTML. > > > > > > This is because I have seen at least one 'product' that reports to > produce > > > PDF from HTML 'files'. > > > > Well, providing you save the generated HTML somewhere (if you just send it > > to the client, then you don't have a copy of it) and this "product" can be > > called through exec(), system(), etc, then sure it's possible. It's going > to > > take another request to the server where you'll load the cached HTML > version > > of the page, run it through the "product", send PDF headers and/or send > the > > PDF file. > > > > Can't give specific examples, but hopefully that gives you an idea. > > > > ---John Holmes... > > Thanks for that John, I think the big issue will be how to 'cache' my HTML > pages should I want to proceed down this route. BTW from memory I think the > 'product' was htmldoc, or similar. > > Graham.

« previous php.general (#197707) next »