Hello
I am currently running a headless server with Ubuntu 8.04 Hardy Heron, Apache, and PHP. What I want to be able to do is save (print) a web page as a PDF without having to worry about the client machine having things like Acrobat Distiller or CUPS-PDF.
What I thought maybe I could do is set up a default printer on the server in CUPS to be a PDF printer. Then, run a system command in the page that saves itself to a pdf. If I print a test page or run the command 'lp <filename>' to a .txt file, it saves a pdf file to my root/PDF directory. This is great, except I want to do this with web pages. I was hoping I could do something like 'lp wget <pageurl>', but of course that doesn't work, and 'lp <filename>.php' just dumps the php code itself into a pdf. I would like to accomplish what I want in this way, though. If there is any command that can print a web page's display using the default printer on the server, that would be great.
I've also looked into things like fpdf, in which I could generate a pdf on-the-fly. However, I was hoping not to go this route since it would require basically a ton more code to generate the files. PHP has pdf building capabilities also, similar to fpdf, which I want to steer away from also. I have over 100 pages and it would just be easier if I could code one solution instead of creating pdf code, classes, and strings in every page for the one time out of 500 that someone might actually want to print/ save a pdf.
Anyway, like I said it would be nice to be able to run the lp command in a page to print the 'display' of the web page, or maybe there is a way to use wget to print. I don't know. Any other ideas of how I should approach this would be greatly appreciated. I already suspect that this cannot be done because of some security issue or something.
Thanks
Jeremy