0

I have researched and checked multiple questions and various answers but cannot find a specific answer.

I have a HTML button that has the event window.print() attached to it at the moment. But what im after is for it to show a print preview. We only use firefox at work so creating a button for us to use which triggers multiple keypresses and brings up the print preview option. In Firefox, the keyboard short-cut for print preview is ALT + F + V or using the below function

18 + 70 + 86

$(window).keydown(function(e) {
 console.log(e.which);
 //18 ALT
 //70 f
 //86 
 //^^ Print Preview
});

I have tried to adapt the following questions answer but to no avail. Way to trigger multiple keypress and hold events in jQuery

Any help would be greatly appreciated.

ROOT
  • 11,363
  • 5
  • 30
  • 45
Daryl Goode
  • 91
  • 2
  • 12
  • you dont want use button for print event and use alt+f+v for print ? – Rakhi Oct 13 '15 at 14:44
  • I have a "Print Table" button. This just has the onclick="window.print()" attached to it. With Firefox if you press ALT F V or Press File -> Print Preview then it comes up with Print Preview. That is what I wanted to happen when the button is pressed. – Daryl Goode Oct 13 '15 at 15:23
  • The view is depend upon browser's capability and funciton you can not achieve it via jquery.However you can design your print layout via print.css – Rakhi Oct 13 '15 at 15:29
  • That is why we use Firefox, In Firefox, this is the key combination to Print Preview. If not jQuery, can it be done in Javascript? If not, what is the general use of triggering the keypress? – Daryl Goode Oct 14 '15 at 08:42
  • Possible duplicate of [How can Print Preview be called from Javascript?](http://stackoverflow.com/questions/230205/how-can-print-preview-be-called-from-javascript) – Teepeemm Jan 14 '16 at 18:18
  • Although that one is extremely old, so maybe things have changed in the meantime. – Teepeemm Jan 14 '16 at 18:18

0 Answers0