Reputation: 3247
I am developping an intranet for a shop. I need to print a receipt by clicking a submit button on php page. I do not want to see Windows print dialog box.
how can I do this. I need some advise
I will use Windows XP, I have full control of the system which this application will be running, Any application/plugin/exploits etc can be installed or used to help with removing the print dialog box.
Regards
Upvotes: 5
Views: 10212
Reputation: 1099
I do this with my shop order system written in PHP and it uses a print dialog via jquery. you can bypass the firefox print dialog by using the about:config page.
That's it, you will no longer see the dialog box when you print. Beware though, it will try to print to the last printer you used when you had the dialog box open. If you ever need to change it then you will need to toggle the value for print.always_print_silent by following the above steps.
Upvotes: 9
Reputation: 2897
Assuming you have the printer attached to the server, you can render the receipt/document to a PDF file, write it to a temporary directory and use the 'shell_exec' function to print it. The shell_exec function executes commands from the command line. Since Windows has something called a command line, it can be usefull.
Be aware that you need a program or batch file installed that can print a PDF from the command line. Such batch file can be found here.
Upvotes: 0
Reputation: 4820
You can't simply pass the pring dialog. I'm not aware of such functionality but could be possible using JAVA.
Upvotes: 0
Reputation: 22446
Javascript can only trigger the print function with window.print()
, but cannot change the way the browser works.
Upvotes: 2
Reputation: 630607
You can't bypass the print dialog, advertisers would be printing out flyers to your printer if this was possible.
Upvotes: 5