Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,

I'm developing application with asp.net MVC Technology its a inventory application i have done some printing options including barcode but i cant print directly im using window.print. when fire this function chrome will show another popup(default web printing popup) for print. then again i want to click print then only i can print. Our client not ready to do something like that.is any other way to print directly or can i go with java script

What I have tried:

I tried JavaScript
Window.print()
Posted
Updated 6-Mar-16 20:28pm

1 solution

You can't bypass this. Browsers won't allow you to directly talk to devices or file system due to security reasons.

Think of a scenario, where you will open a website, which will send print commands directly to your printer without your knowledge. It can print whatever it wants, right? That should be restricted. So, browsers will take user's permission to talk to the device and that is a good approach.

So, explain this to the client. This is not in your hand. If you want to directly talk to printer, then you need to do desktop apps rather than web apps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900