J'essaie de créer des pieds de page personnalisés comme dans les exemples de phantomjs : https://github.com/ariya/phantomjs/blob/master/examples/printheaderfooter.js
Voici mon code :
var phantom = require('node-phantom');
phantom.create(function (err, ph) {
ph.createPage(function (err, page) {
page.set('paperSize', {
format: 'A4',
orientation: 'portrait',
footer: {
contents: ph.callback(function (pageNum, numPages) {
if (pageNum == 1) {
return "";
}
return "<h1>Header <span style='float:right'>" + pageNum + " / " + numPages + "</span></h1>";
})
}
}, function () {
page.open('http://www.google.com', function () {
})
})
})
});
Mais malheureusement, j'obtiens l'erreur suivante :
TypeError: Object #<Object> has no method 'callback';
Est-ce un bogue que ph n'expose pas la méthode de rappel ?