3

I need to print a pdf file directly without showing print preview. When i am using

window.print() it goes to windows print preview page. But i need to send the file directly to the printer without showing print preview page

Yadhu Phinix
  • 57
  • 1
  • 1
  • 7

2 Answers2

2

Thats not possible with pure javascript and html. You'll need to use silverlight 5 (Signed), flash or qz-print - js wrapper which uses java.

For i.e. specific solution following may work

javascript print without print dialog box

I have personally implemented only silverlight 5 (Signed), I have not my self implemented flash and qz-print.

Hope this helps!

Community
  • 1
  • 1
Dave Amit
  • 2,299
  • 12
  • 17
  • Thanks for your support sir. But i need to implement above feature in PHP – Yadhu Phinix Mar 02 '16 at 05:36
  • 1
    Then I'll wish you luck my friend! I am 100% sure pure html and js won't cut it. You'll need to add some native component. You can write a browser add-on if its not a public site. Anyways! Best of luck my friend. – Dave Amit Mar 02 '16 at 05:46
  • If any success on this achieve in php means please share the code, I'm looking for this code now. Please help anyone. – Vinoth Kumar Dec 17 '20 at 14:45
0

Browsers will not allow that to happen. You can use the below plugin to provide beautiful previews.

https://github.com/etimbo/jquery-print-preview-plugin

Demo: http://etimbo.github.io/jquery-print-preview-plugin/example/index.html

Rohan
  • 3
  • 3