[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

Save Web Page as PDF on Server From Client Machine

Asked by jsdegard in WebApplications, Linux Printing

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
 
Related Solutions
Keywords: Save Web Page as PDF on Server Fro…
 
Loading Advertisement...
 
[+][-]05/01/09 01:08 PM, ID: 24282978Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/01/09 01:58 PM, ID: 24283379Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/01/09 02:05 PM, ID: 24283428Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/01/09 02:17 PM, ID: 24283502Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/04/09 07:51 AM, ID: 24295691Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/04/09 09:50 AM, ID: 24296877Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/04/09 10:56 AM, ID: 24297478Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/04/09 10:57 AM, ID: 24297498Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/04/09 11:09 AM, ID: 24297610Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/04/09 11:19 AM, ID: 24297693Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/04/09 11:23 AM, ID: 24297727Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/04/09 11:50 AM, ID: 24297954Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/04/09 12:17 PM, ID: 24298225Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625