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

799
Views
Cómo imprimir sin cuadro de diálogo de vista previa usando javascript en laravel

Estoy trabajando en la impresión del recibo cuando hago clic en imprimir. Espero que se imprima directamente sin el cuadro de diálogo de vista previa de impresión.

Mientras buscaba esto, la mayoría de las respuestas fueron configurar la configuración del navegador.

¿Se puede hacer mediante programación? Estoy usando laravel para mi proyecto.

Guión utilizado para la impresión

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

0

Este artículo puede ayudarlo a cotizar directamente a la impresora del cliente sin cuadro de diálogo.

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

o use el siguiente script si su navegador lo admite.

 <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!