Print page on local computer using php (javascript) without windows print dialog

I am creating an intranet for a store. I need to print a receipt by clicking the submit button on the php page. I do not want to see the Windows print dialog.

How can i do this. I need to advise

I will use Windows XP, I have full control over the system in which this application will work. Any applications / plugins / exploits, etc. can be set or used to eliminate the print dialog. A.

Hello

+4
source share
5 answers

I do this with my store ordering system written in PHP and use the print dialog through jquery. you can bypass the firefox print dialog using the about: config page.

  • Open firefox and put about: config in the address bar and press enter (you need to press a button that shows that you know what you are doing)
  • Enter print.always_print_silent in the filter field at the top. If you have an entry already there and it is set to false, just right-click it and select "toggle" to set it to true. If there is no entry, then ...
    • right click on the screen and select New-> boolean
    • type print.always_print_silent as the preference name when prompted and press enter
    • set boolean true and press enter

To do this, you will no longer see a dialog box when printing. Beware, however, it will try to print the last printer you used when you opened the dialog box. If you ever need to change it, you will need to switch the value for print.always_print_silent by following these steps.

+7
source

You cannot bypass the print dialog; advertisers will print leaflets to your printer, if possible.

+4
source

Javascript can only run the print function with window.print() , but it cannot change the way the browser works.

+2
source

You cannot just pass the pring dialog. I do not know about such functions, but I can use JAVA.

0
source

Assuming the printer is connected to the server, you can display the receipt / document in a PDF file, write it to a temporary directory, and use shell_exec 'to print it. The shell_exec function executes commands from the command line. Since Windows has something called the command line, it can be useful.

Remember that you need a program or batch file that can print PDF from the command line. Such a batch file can be found here .

0
source

All Articles