Save you site in pdf format?

Discuss phpwcms here, please do not post support requests, bug reports, or feature requests! Non-phpwcms questions, discussion goes in General Chat!
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Save you site in pdf format?

Post by frold »

Hey

I think it would be cool if you could save your whole site in pdf format and therefor I took a quick look on http://www.fpdf.org... but did any of you tried to save your site in pdf format and is it possible to save you site in pdf format?

Hope a wizard can make it possible :D
http://www.studmed.dk Portal for doctors and medical students in Denmark
duergner
Posts: 139
Joined: Fri 14. May 2004, 12:10

Post by duergner »

FPDF is not the tool one want to use to create high quality PDF output I think. I'm currently working a bit with XML-FO; seems to be very powerful and the tool that would fit here best, because you can not only create PDF then, but RTF and other formats too when you hava exportet the content to XML.
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

but fpdf seems to be "easy" to use .....
http://www.studmed.dk Portal for doctors and medical students in Denmark
duergner
Posts: 139
Joined: Fri 14. May 2004, 12:10

Post by duergner »

For smaller things I would agree; but I couldn't find out how to make block layout with this tool till now. And that is for me e thing I would need in all cases when saving a website for example.
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

duergner wrote:I'm currently working a bit with XML-FO; seems to be very powerful and the tool that would fit here best, because you can not only create PDF then, but RTF and other formats too when you hava exportet the content to XML.
Do you think you will make a "add-on"/"MOD" for phpwcms that make you save your site in pdf or is you just playing with it? And if so do you have a deadline? :lol: :D
http://www.studmed.dk Portal for doctors and medical students in Denmark
duergner
Posts: 139
Joined: Fri 14. May 2004, 12:10

Post by duergner »

frold wrote:Do you think you will make a "add-on"/"MOD" for phpwcms that make you save your site in pdf or is you just playing with it? And if so do you have a deadline? :lol: :D
I will try to use a other project from FPDF to XML-FO for PDF output. I'll try to write a add-on for phpWCMS some time, but that'll take some time, as I'll first of all have to do some learning for university till the middle july.

And I think it'll be quite a lot of work as you have to implement some XML output for each content-part that'll bring the content into a structure. After that you'll have to use an XSLT stylesheet on that output to create an XML-FO document and after that create the PDF file out of this.

So I think it'll take at least 2 month from now on till I'll be productive.
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post by DeXXus »

Discovered this project and thought I'd just mention it in this thread :wink:
http://pdml.sourceforge.net/index.php
Portable Document Markup Language

PDML is an informal markup language written in 100% PHP, allowing to create complex PDF documents very easily for people already familiar with HTML. People familiar with PHP can also use it as a way to define templates for dynamic PDF documents.
PDML is built on top of FPDF, and is licensed under the GPL. This project is very new. Our first goal is to expose as much of the feature-set of FPDF as possible. Please note that the current markup is not final and will likely be adjusted as the project matures.
To quickly understand what PDML can do, please check out our examples.
Note: 0.9 is out, featuring cells, ellipses and multi-columns
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

Okay cool... but I don´t know if it can work together with mysql?
http://www.studmed.dk Portal for doctors and medical students in Denmark
duergner
Posts: 139
Joined: Fri 14. May 2004, 12:10

Post by duergner »

DeXXus wrote:Discovered this project and thought I'd just mention it in this thread :wink:
http://pdml.sourceforge.net/index.php
Portable Document Markup Language

PDML is an informal markup language written in 100% PHP, allowing to create complex PDF documents very easily for people already familiar with HTML. People familiar with PHP can also use it as a way to define templates for dynamic PDF documents.
PDML is built on top of FPDF, and is licensed under the GPL. This project is very new. Our first goal is to expose as much of the feature-set of FPDF as possible. Please note that the current markup is not final and will likely be adjusted as the project matures.
To quickly understand what PDML can do, please check out our examples.
Note: 0.9 is out, featuring cells, ellipses and multi-columns
Why is this better than XML-FO? When there are no improvements than I can't see why one should use that and not use the standard from W3C. Nobody knows, how long you project will be alive. I don't want to make your work bad, but right now I can't see why using not the standard things but special implementations.
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

Well I just see PDML as a addon to fpdf and totally other solution then xml-fo.....
http://www.studmed.dk Portal for doctors and medical students in Denmark
duergner
Posts: 139
Joined: Fri 14. May 2004, 12:10

Post by duergner »

OK but I think as there is the possibility XML-FO available and it is very powerful, I think solutions like FPDF and add-on will become less important fo the things we are talking about here.

The great advantage of XML-FO is IMHO that you can't just export it as PDF but other formats as well when the XML-FO document is created. And the creation of the XML-FO document can be done more or less automatically by a XSL stylesheet.

That's why I would prefer XML-FO as solution for this instead of FPDF. As I thinks the power of FPDF is limited.
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

Okay but I don´t know anything about xml-fo - where to start?

and what programmar skill you need to have to start?
http://www.studmed.dk Portal for doctors and medical students in Denmark
duergner
Posts: 139
Joined: Fri 14. May 2004, 12:10

Post by duergner »

I don't know exactly too. Frist of all I think we need a XML file that contains the information of the article. That for I think, this XML file should be created by the article and its content parts. Each content part should return the part of the XML file that he offers. That XML file needs to be transformed by an XSL stylesheet into the XML-FO document. (The way round the XML file because I think this could be used to simply apply user templates to articles and contentparts then by just implementing an XSL stylesheet that transforms this XML file into (X)HTML code. That means I would prefer (don't know whats Olivers opinion on that) that the templates for contentparts are XSL stylesheets, becuase that would minimize the double coded things a bit). This XML-FO document can than be used to create the PDF document.

I will read something about XML-FO and using it to ceate PDF's in the next days. I'll post the things that need be coded (in my opinion) afterwards here. Perhaps Oliver can say somethings about the idea to use plain XML (that contains only the data) and XSL stylesheets for a template system for contentparts (and articles) till that time.
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

It sounds so easy - but I think that it is not.....

But I look forward to here what you can tell after you have read it....
http://www.studmed.dk Portal for doctors and medical students in Denmark
duergner
Posts: 139
Joined: Fri 14. May 2004, 12:10

Post by duergner »

OK I've read something about that yesterday. The creation of the XML-FO document is as easy as creating the FPDF things in my opinion. You just have to create a XSL stylesheet, that transforms the XML document that contains the data into a XML-FO document that contains formatting information too. That you have also to do, more or less, in a other way when you want to use FPDF or any other markup language I think.

One problem that occurs at the moment seems to be, that I couldn't find a PHP implementation of a XML-FO 'program' that creates the PDF file out of it. There is for example FOP developed by the XML project of the Apache Foundation, but that tool is written in Java.

So I think there are three possibilities at the moment:
1. We use FPDF right now and are content with its limited possibilities.
2. Someone finds a PHP implementation of a XML-FO parser.
3. We try to make a PHP port of FOP. (I don't know right now if it's possible as I haven't had the time to take a look at the source till now)

The easiest way would be right now to use FPDF I think, but I'm not very content with that. The nicest way would be the second one. I would right know tend to try possibilyt number three, when possibility number two fails. But that would mean, that'll take some time, till this feature would be available.
Post Reply