How to set Safari print margins via CSS to print borderless

前端 未结 2 1935
误落风尘
误落风尘 2020-12-13 08:03

I want to print a webpage to PDF without any margins in Safari. Page size is set to \'A4 borderless\' in the print dialogue.

Whatever I seem to do, Safari on OSX is

2条回答
  •  旧时难觅i
    2020-12-13 08:29

    There is 3 things to take in consideration:

    1. The margin of the page's rule, unfortunately

      @page {
      margin: 0cm !important;
      }
      

      Has no effect on Safari 6, where it does in Chrome 23. As I know, as long as Safari is not supporting this, there is no solution (it seems to be fixed to around 10mm).

    2. The page setting as seen here you might have to define a custom "Paper Size" in the "Print…" menu panel without any margin (you did it already btw).

    3. Obviously to take care of the other inner content html, body… not to have any margin.

提交回复
热议问题