Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
520 views
in Technique[技术] by (71.8m points)

网页怎么打印设置纸型与横竖版?

怎么在网页HTML或js中设置打印样式?
在代码中设置好纸型,如a3或a4;并设置横板打印!不需要用户自己去设置,有些用户不会选。
有办法吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
<style>
  @media print {
    @page {
      size: A4 landscape; /* 纵向:portrait,横向:landscape */
    }
  }
</style>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...