• 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

Print the content of PDF

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have to print the content of PDF in java file, without print dialog window. When I click the button near to the file name in the JSP it should print one copy of the file. Can anybody help me out to achieve this functionality.

Thanks,
-Balaji
 
author & internet detective
Posts: 41871
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let's start by talking about the question. You want to use JavaScript to print, not Java. Java runs on the server; JavaScript runs on the user's machine.

You can use JavaScript to launch the print confirmation dialog. You cannot just print without the user's permission.
 
Balaji Soundarajan
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to do this in java, when I click the hyperlink, the content of the file has to print. Meanwhile I need to disable the print dialog window, all the configuration has to do in code itself like number of copies, landscape or portrait.
 
Sheriff
Posts: 67747
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
Despite what you want, you can only do what's possible. If you want the file to print on the client machine, that means JavaScript, not Java. And there is no way to get the file to print without the dialog.

Just imagine the security nightmare if any website could cause spam to print on your printer whenever you visited them.
 
Marshal
Posts: 28220
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Somebody insists on Java? You could perhaps do that from an signed applet, then. But I don't see where a JSP would come into the picture; it runs on the server, where it has no access to the client's printers or even the client's files.

Unless perhaps the file is supposed to print on a printer on the server? You didn't exactly explain your requirements very clearly.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic