In this below script, Print css using Window.print

<style type="text/css" media="print"> @page { size: auto; /* auto is the initial value */ margin: 0; /* this affects the margin in the printer settings */ } </style>
@page :left { margin-left: 4cm; margin-right: 3cm; } @page :right { margin-left: 3cm; margin-right: 4cm; }