View Full Version : xml -> html -> pdf

01-21-2003, 05:26 AM
Ok, I hope somebody can at least tell me where to get started on this project..

I need to build a website that will be 10 - 15 static pages. One of the requirements is that all the pages will need to be presented in html as well as pdf, in a brochure like format for printing.

I have been reading a little about customizing pdfs using the FDF format with PHP and I think something along this line is what I need.

What I want to do is write the content into an xml file, that can then be translated into HTML or pdf dynamically. I am very new to xml and php, though i have a decent bit of experience with perl.

So i have a few questions..

Can this be done? I'm pretty sure it can, but I'd like a second opinion.

Is it worth it to do it this way?

Anybody already have a good resource that touches on this?

Any other direction / info would be helpful.

Thanks, Jesse

01-21-2003, 05:45 AM
Just have one XML file, and then an XSLT document to convert it to XHTML, and another to convert it to XSL-FO. XSL-FO can be converted into PDF with a free utility at apache.org I believe.

01-21-2003, 05:51 AM
OK, some dumb questions if you don't mind.. one xml document for each page, or the whole site?

So is XHTML just xml converted to html via xslt?

And is what you are describing something that would happen dynamically whenever the page is loaded, or would the files be created and saved as static files?


01-21-2003, 01:12 PM
I'd probably do an individual XML document for each page. It should just be information, and nothing but.

As for dynamic transforms, or statically saved files, you could go either way, though it might be easier/quicker in the long run to have the server transform them once, and be done with it.