Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 381
  • Last Modified:

Can you print files from a web page?

I am looking for a way to send files to a user’s printer from a web page.

Generally, what needs to happen is the user goes to a web page which displays a list of files (pdf files in this case). The user may select one or more files and clicks “Print”. The files are found on the server and sent to the printer automatically. If there are more than one file, they are all printed automatically without further user intervention. Note, I am not interested in printing the web page, but rather files on the server.

I know this is a tall order for a web-based page. I am not looking necessarily for specific code, but I would like to know:

Is it possible?
What scripting language(s) would best handle this?
What particular functions in the language of choice should I look at?

Points may be shared for this one based on clarity and depth of detail.
0
gpinzino
Asked:
gpinzino
3 Solutions
 
effxCommented:
The only thing I would think of for this situation is build a compiled PDF which allows them to download only one file but have all the documents in one.

Outside of this I dont think it is possible initiate a print from script, (BTW experts I don't mean produce the print dialogue)
0
 
Ray PaseurCommented:
I think giving the client links to the PDF files would be the best solution.  Click and it starts the Acrobat Reader plug-in.  The client can control the printer settings.

Another option might be to put a list of PDF files on the screen with checkboxes beside them.  When the client selects some PDF files and submits the form, you might use FPDF to concatenate the PDF documents together into one printable document.  Then the action script could give the client a link to the merged PDF document.
0
 
effxCommented:
@Ray, is that not just what I said? compiled==concatenate==merged?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Ray PaseurCommented:
It may also be possible in JavaScript.  Example: Google Maps has a "print me" link.
0
 
effxCommented:
the print me button presents the print dialogue, pretty standard function
0
 
Dave BaldwinFixer of ProblemsCommented:
To print on a local printer, a file must be downloaded from the server and saved (at least temporarily) on the user's computer.  In Windows, almost Nothing will print without loading a program to print it because most files have a format that must be interpreted by the program that created it.  To do this "automatically" violates several security restrictions on web browsers and external files.

You might be able to do this from the server on an intranet with something like Active Directory with a program that would select the user's local printer from the server and tell the program to use that printer.  It gets pretty involved and most of it would be done on the server.  The files would still have to be opened by the correct program but this time on the server.
0
 
Ray PaseurCommented:
the print me button presents the print dialogue, pretty standard function

Agreed.  If the design pattern is good enough for Google, it's probably good enough for me, too.

The link for FPDF is here (it is free and open source)...
http://fpdf.org/
0
 
gpinzinoAuthor Commented:
What a great discussion. Using links or checkboxes to launch the files in Reader seems to be the best way to go. I was just hoping I could avoid the myriad instances of pdf clients resulting from the user selecting half a dozen or more files to print. I guess we will just have to deal with that limitation.

I will take a look at FPDF to see if it has any features that might help me. I may look into the possibility of merging, too.

I've split the points among you (Sorry effx. I haven't yet learned to divide by 3 without a remainder).
0
 
Ray PaseurCommented:
Thanks for the points and if you find a way to divide 500 by 3 without a remainder, please show us :-)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now