• 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

Acrobat javascript

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

I have a problem with printing pdf files coming from my server. I have to include a functionality such that when the user clicks on a print button on the page, the page is sent to the printer(user's printer) without going through the Print dialog. I am viewing the PDF in the browser.

I read an article on Acrobat JS and wanted to know whether its possible to include an init method in Acrobat Javascipt so that when the pdf opens, the print command is issued(javascript invocation) and the window is closed(javascript invocation). Thats one way i thought of avoiding the Print dialog.

Any suggestions, tutorials, articles or code samples on how to avoid print functionality wouldbe helpful.



Thanks,

Kailash
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you were able to do this, you would be surfing the net and andom things would print. Not good! You can look into activeX, but an action will have to be taken by the user most likely.

Eric
 
Zip Ped
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your response Eric. Unfortunately, I can't use ActiveX. There are or were a few bugs in IE because of which you could close browser windows without prompt and print without prompt. Thats not a good solution either. I am still looking for an alternative....
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With what you just said, is a reason why you are not going to be able to acomplish this goal. Open up the window and let your users print the document and close it when they are done. There is no direct access to the printer. If you really need this, then you should probably look into a client application and not a web application. I always tell people to build the application around the browser, not the other way.

Eric
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With what you just said, is a reason why you are not going to be able to acomplish this goal. Open up the window and let your users print the document and close it when they are done. There is no direct access to the printer. If you really need this, then you should probably look into a client application and not a web application. I always tell people to build the application around the browser, not the other way.

Eric
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With what you just said, is a reason why you are not going to be able to acomplish this goal. Open up the window and let your users print the document and close it when they are done. There is no direct access to the printer. If you really need this, then you should probably look into a client application and not a web application. I always tell people to build the application around the browser, not the other way.

Eric
 
Zip Ped
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm...too many submits???

Well, first thing. This is a small part of the web application I am working on. I cant use a client application.

I found a way to print the pdf from server side java code. The same functionality can also be achieved by using applets. However I need to test them first.
 
Your mother is a hamster and your father smells of tiny ads!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic