Direction/Help for automatically printing PDFs on browser side

Posted on 2013-10-03
Medium Priority
Last Modified: 2014-10-22
My questions is a general one:

I am trying to figure out how to automatically print a dynamically server-side created PDF file streamed out to the client-side browser. I have searched the internet and have not found a solution, whether it be an ActiveX control, java control, or Adobe PDF object, or ???

I am hoping to get a link to an solution, or suggestions, or any help in trying to understand how to do this.

I am fairly certain this is doable with a trusted website and/or an ActiveX control or java control. I just can't find any examples of how to do it.

I have found a website that eludes to it being done:


But not HOW to do it.

I am willing to work in java, VB.Net, javascript, whatever to get this done as I have a background in all of them. But my preferred language is c#.

The solution can be based in Windows browser only, though compatibility would preferably be for all browsers and at least for all Windows based browsers.

Thanks for any help in advance.
Question by:VirtualMAK
LVL 58

Accepted Solution

Gary earned 800 total points
ID: 39543654
You can initiate the print dialog in js with

But you cannot force a direct print - that is upto the user.
Is this an embedded PDF?

Author Comment

ID: 39543908
The link I gave would indicate there is a way to do this with a trusted website.

I would think you could also do this with a signed ActiveX or java control. Or maybe a client side webservice? Not sure what has to be installed for a webservice to be available on a client machine though - that may not be doable.

But I certainly have not found anything to indicate your statement is wrong. I just find it hard to believe that if there is signed trust on the connection or between client-server objects you can not do this.
LVL 58

Expert Comment

ID: 39543985
Even in the link you gave they are referring to the print dialog - you cannot force a printout without the user themselves actually doing it.
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

LVL 58

Expert Comment

ID: 39544035
What is you market? Is this a public facing site or a restricted group.
If it is a controlled market, you could possibly use an ActiveX but you would need to disable a lot of the security built into the browser and would only be for IE

Author Comment

ID: 39544196
We are an internet service that processes transactions and prints a receipt, hopefully automatically. I have come across several web articles that eludes to the ActiveX solution but nothing about how to go about it. There has also been some for java based solutions as well, but again nothing 'concrete' on the doing.

Only being IE is fine as our users are controlled and would be able to download the solution ActiveX control prior to use.

I just have no experience with ActiveX controls doing something outside the usual interface extending stuff. How would an ActiveX control interact with outside-of-browser services/applications? That is what I need help with, so a link or an example would be awesome!

Author Comment

ID: 39544213
GaryC123 - Also, the link I provided states:

The PDF should open in a new window and print
Be aware that printing is routed to your default printer, so you will need to have a printer connected or
you will need to be able to send your printing to a shared printer at the feis.

This sounds to me like the secondary window automatically prints to the default printer without user interaction. But maybe I am reading that wrong.
LVL 58

Assisted Solution

Gary earned 800 total points
ID: 39544270
In the link it shows the Launch Print Dialog.. with a dropdown. And what they seem to be doing there is local thing and not through a browser.
ActiveX would be out of the question then.
It is possible through Java

I'll add the Java zone to your question
LVL 35

Assisted Solution

by:Paul MacDonald
Paul MacDonald earned 400 total points
ID: 39544301
* allude

The only way I can think of to do this would be to have a client application that queries a web service (or monitors a file drop) for the PDF in question and prints it locally.  The application could allow the user to specify a printer ahead of time.
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 400 total points
ID: 39544421
Even outside of a browser, I don't know of anything that prints automatically.  None of the programs that I have used since 1980 have ever done that.
LVL 53

Assisted Solution

COBOLdinosaur earned 400 total points
ID: 39546441
I have searched the internet and have not found a solution, whether it be an ActiveX control, java control, or Adobe PDF object, or ???

Exactly what does it take to translate "you can't do that".

The fact that you have not found a solution on the internet and you have been told by experts that you can't do it; should be delivering the message.  The user must agree to the print and indicate that agreement with some action.  The reason is very simple, if you could go to the printer automatically and there is no printer online it might create a fatal error that could cause a serious problem for the user's computer.


Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

There is a wide range of advantages associated with the use of ASP.NET. This is why this programming framework is used to create excellent enterprise-class websites, technologies, and web applications.
A discussion about automated testing of Web Applications utilizing Selenium, along with illustrated configuration steps for the Jenkins open source tool.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question