[PHP] HTML (to XML?) to PDF
Here is my situation: I've got HTML Templates that I'm using to parse and presents the end result to the user. Here is my dilemma: I need to take what is presented to the user (ie, the data less the HTML tags but maintaining the formatting) and turn it into a PDF file. I know I can use PDFLib to turn data into a PDF. However, it doesn't understand HTML so I can't just send it the same thing I'm sending to the browser via stdout. Is there a routine, a class or a set of functions out there that would take the result and give me just the data the end user sees (ie, less the HTML tags)? Or even turn the HTML into XML? One thing to remember, since this is using the results of a parsed template, I would need to be able to do all of this on the fly. I don't necessarily need the code that does this, just pointers on where I can go look and find out how I can do this. Thanks for any help you can provide! Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML (to XML?) to PDF
On Tuesday, March 19, 2002, at 03:48 PM, Chris Boget wrote: > I need to take what is presented to the user (ie, the data less the > HTML tags but maintaining the formatting) and turn it into a PDF > file. > > I know I can use PDFLib to turn data into a PDF. However, it > doesn't understand HTML so I can't just send it the same thing > I'm sending to the browser via stdout. Is there a routine, a class > or a set of functions out there that would take the result and give > me just the data the end user sees (ie, less the HTML tags)? Or > even turn the HTML into XML? > One thing to remember, since this is using the results of a parsed > template, I would need to be able to do all of this on the fly. > > I don't necessarily need the code that does this, just pointers on > where I can go look and find out how I can do this. > Thanks for any help you can provide! Hm. If you can't store the data as XML from the beginning (doesn't it make more sense to go from XML to HTML than vice versa?), you might still be able to get away with using XSLT to do what you want. I think in order for it to work your initial document has to be some kind of XML, but XHTML should work in theory. What I just said came out somewhat confusing -- If your initial document is in XHTML form, you should be able to use XSLT, since XHTML is a form of XML. HTH, Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML (to XML?) to PDF
> Hm. If you can't store the data as XML from the beginning (doesn't it > make more sense to go from XML to HTML than vice versa?), Yes, it does. However, the people creating these templates don't know XML, only HTML. As such, that is how they are going to be stored. :| > If your initial document is in XHTML form, you should be able to use > XSLT, since XHTML is a form of XML. Yes, that would be the ideal situation. However, that won't be the case. So I need to find out some way to be able to either: * Print the HTML (less tags, keep formatting) to PDF * Convert the HTML to XML to I can then pass that onto the PDFClass we are using. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML (to XML?) to PDF
> I need to take what is presented to the user (ie, the data less the > HTML tags but maintaining the formatting) and turn it into a PDF > file. I found the solution with HTMLDoc (http://www.easysw.com/htmldoc/) It was very easy to set up and use. I heartily recommend it for anyone who has the same problem I had. Thanks for all the suggestions! Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php