• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Printing file without opening it

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
I have a JSP page which has a hyperlink to a pdf file. I want to print this PDF file without opening it... Can someone help me out with this, and it is real fast and urgent...
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are going to have to open the file in order for it to print... Now you have 2 options. Since you are going to be opening a pdf, it is going to take control of the browser. You are not going to be able to run any commands to print it.
There is another method. You can use frames and have the top frame(zero height) print the bottom frame containing the pdf and close the entire window after calling print. BUT the problem you are going to run into is the following,...You would not know how long to set the timeout for since you do not no page loading time. 2 when it says to print, the print dialog is going to pop up so it will not be so seamless when it closes, and some browsers may not even want to print it.
Sure I lost you with my bad grammer.....
Pain in the rear....eh....
But this is good since I would not want someone printing 1000 pages on my printer when I visit a website!
Persoanlly I would say.....click on the link and print out this form....
Eric
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can try the following:

Should work on any unix machine with wget and xpdf installed, and a postscript printer or interpreter. Should also work with windows under cygwin.
 
Chicken Farmer ()
Posts: 1932
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sending this to the HTML and Javascript forum, since it's more dealing with the proper use of hyperlinks and all that gobbledy gook Eric is talking about
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a dupe of this topic in the JSP forum.
I think a server-side approach is best, but in any case, one of these should be closed and refer to the other. Since I can, I'm closing the topic in JSP and referring it here.
(Though I actually think Servlets is the most appropriate locale.)
bear
 
Clowns were never meant to be THAT big! We must destroy it with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic