Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

791
Views
How to print without preview dialog box using javascript in laravel

I am working on the receipt print when i click print i am expecting it to be print directly without the print preview dialog box.

While searching for this most of the answers were configure the browser setting.

Can it will be done programmatically i am using laravel for my project

Script used for Printing

<script type = 'text/javascript'>  
  window.onload = function(){ window.print(); }
</script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This article can help you pricing directly to client printer without dialogue box.

https://www.neodynamic.com/articles/Print-HTML-from-Javascript-to-client-printer-without-print-dialog-silently/

or use following script if your browser supports It.

<form> <input type="button" value="Print Page" onClick="window.print()"> </form> <script language="VBScript"> // THIS VB SCRIP REMOVES THE PRINT DIALOG BOX AND PRINTS TO YOUR DEFAULT PRINTER Sub window_onunload() On Error Resume Next Set WB = nothing On Error Goto 0 End Sub Sub Print() OLECMDID_PRINT = 6 OLECMDEXECOPT_DONTPROMPTUSER = 2 OLECMDEXECOPT_PROMPTUSER = 1 On Error Resume Next If DA Then call WB.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,1) Else call WB.IOleCommandTarget.Exec(OLECMDID_PRINT ,OLECMDEXECOPT_DONTPROMPTUSER,"","","") End If If Err.Number <> 0 Then If DA Then Alert("Nothing Printed :" & err.number & " : " & err.description) Else HandleError() End if End If On Error Goto 0 End Sub If DA Then wbvers="8856F961-340A-11D0-A96B-00C04FD705A2" Else wbvers="EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B" End If document.write "<object ID=""WB"" WIDTH=0 HEIGHT=0 CLASSID=""CLSID:" document.write wbvers & """> </object>" </script>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!