print to pdf setting css for A4 size

77

@media print {  
  @page {
    size: 210mm 297mm; /* portrait */
    /* you can also specify margins here: */
    margin: 0;
    margin-right: 0; /* for compatibility with both A4 and Letter */
  }
}
@page {
  size: A4;
  margin: 0;
}
@media print {
  html, body {
    width: 210mm;
    height: 297mm;
  }
  /* ... the rest of the rules ... */
}

Comments

Submit
0 Comments