Jes Sie

Jes Sie

  • 699
  • 1.2k
  • 265.2k

How to change page orientation in jquery

Apr 23 2020 10:51 PM
Hello everyone,
 
I found this beautiful jquery to print pages from html:
  1. <script>  
  2.                       
  3.                     function PrintPanelAttachment() {  
  4.                         var panel = document.getElementById("<%=pnPrintAttachment.ClientID %>");  
  5.                     var printWindow = window.open('''''height=1000,width=900');  
  6.                     printWindow.document.write('<html><head><title>Dhipaya Insurance Program</title>');  
  7.                     printWindow.document.write('</head><body >');  
  8.                     printWindow.document.write(panel.innerHTML);  
  9.                     printWindow.document.write('</body></html>');  
  10.                     printWindow.document.close();  
  11.                     setTimeout(function () {  
  12.                         printWindow.print();  
  13.                     }, 500);  
  14.                     return false;  
  15.                 }  
  16.                   
  17.                 </script>  
 How do we change the page orientation from portrait to landscape and vise versa? Also, is it possible to add CSS link? Thank you all for any help.
 
Cheers. 

Answers (4)