Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

792
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda