WKHTMLTOPDF: How to disable header on the first page

后端 未结 5 1576
终归单人心
终归单人心 2021-02-06 03:39

wkhtml doesn´t repeat table elements \"th\" on every page like it should. So I thought it could be possible to simply use the --header-html option and add the table headers manu

5条回答
  •  温柔的废话
    2021-02-06 03:56

    For some reason, Nenotlep's answer didn't worked for me. It removed only page number..

    So I created a class with a display: none; and simply added it. It worked this way.

    function pagination() {
      var vars = {};
      var x = document.location.search.substring(1).split('&');
      for (var i in x) {
        var z = x[i].split('=', 2);
        vars[z[0]] = unescape(z[1]);
      }
      var x = ['frompage', 'topage', 'page', 'webpage', 'section', 'subsection', 'subsubsection'];
      for (var i in x) {
        var y = document.getElementsByClassName(x[i]);
        for (var j = 0; j < y.length; ++j) y[j].textContent = vars[x[i]];
    
        if (vars['page'] == 1) {
          var element = document.getElementById("pager");
          element.classList.add("pager-hidden");
        }
      }
    
    }
    .pager {
      font-size: 0.09375in;
      padding-right: 1.00003in;
      text-align: right;
      letter-spacing: 0.01042in;
      padding-bottom: 0.37501in;
    }
    
    .pager.pager-hidden {
      display: none;
    }
    
    
      
    Page /

提交回复
热议问题