Header and footer are not rendered

Bug #1676518 reported by Martin PANEL
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
phantomjs (Ubuntu)
New
Undecided
Unassigned

Bug Description

I'm trying to define a header and footer during half-day following the paperSize param documentation http://phantomjs.org/api/webpage/property/paper-size.html , however this does NOT work on the ubuntu build.

It's working with the binary provided by phantomjs website : http://phantomjs.org/download.html

Easy to reproduce :

easy.html:
<h1>WTF</h1>

index.js:
var fs = require('fs');
var page = require('webpage').create();
page.onLoadFinished = function () {
  render()
}

page.paperSize = {
  format: 'A4',
  margin: "1.5cm",
  footer: {
    height: '4cm',
    contents: phantom.callback(function(pageNum, numPages) {
      return "Footer " + pageNum + " / " + numPages + "";
    })
  }
};

var html = fs.read('easy.html');
page.setContent(html, './any.html');

function render () {
  page.render('out.pdf')
  page.close()
  phantom.exit(0)
}

Then simply run :
# phantomjs index.js

You should go out.pdf file, with the Footer, but you do not got the Footer.
Crazy isn't it ?

I'm on Ubuntu 16.04.2 LTS
phantomjs 2.1.1 (same version in the package as on the website)

enio (enioribeiroo)
information type: Public → Public Security
information type: Public Security → Public
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.