phantomjs/src
Milian Wolff 24a9665c4d Make it possible to print pages with user-defined headers/footers.
Usage:

page.paperSize = {
  margin: "1cm",
  header: {
    height: "1cm",
    contents: phantom.callback(function(pageNum, numPages) {
      return "<h1>" + pageNum + " / " + numPages + "</h1>";
    })
  },
  footer: {
    height: "0.5cm",
    contents: phantom.callback(function(pageNum, numPages) {
      return "<h2>" + pageNum + " / " + numPages + "</h1>";
    })
  }
};

Note: The contents can return arbitrary HTML but since we cannot
re-layout the whole website for every page, the header/footers
must have the static height defined in the height property.

Note: The new example printheaderfooter.js shows the usage. It
also shows how one could delegate the above to a JavaScript
function on the loaded website, which allows one to print pages
and let the actually printed page decide how the header/footer
should look like.

Note: The page-counter can be reset by adding the class "phantomjs_reset_pagination"
to HTML block-elements that should reset the counter.

ISSUE: 410 (http://code.google.com/p/phantomjs/issues/detail?id=410)
2012-04-14 22:04:34 -07:00
..
gif No need for stdint.h and unistd.h when building with MSVC 2012-03-12 21:04:55 -07:00
linenoise Create an import script for LineNoise. 2012-03-12 20:44:04 -07:00
modules Squashed commit of the following: 2012-04-10 23:52:56 -07:00
mongoose Build: Apply FreeBSD patch to build Mongoose. 2012-03-12 23:45:59 -07:00
qt Make it possible to print pages with user-defined headers/footers. 2012-04-14 22:04:34 -07:00
bootstrap.js Make it possible to print pages with user-defined headers/footers. 2012-04-14 22:04:34 -07:00
callback.cpp Make it possible to print pages with user-defined headers/footers. 2012-04-14 22:04:34 -07:00
callback.h Make it possible to print pages with user-defined headers/footers. 2012-04-14 22:04:34 -07:00
coffee-script.js Update CoffeeScript compiler to version 1.3.1. 2012-04-11 00:46:43 -07:00
config.cpp Remove setting and command-line option for plugins loading. 2012-03-23 07:42:17 -07:00
config.h Remove setting and command-line option for plugins loading. 2012-03-23 07:42:17 -07:00
configurator.js Implement JSON config loader 2011-08-30 00:43:41 +09:00
consts.h Remove setting and command-line option for plugins loading. 2012-03-23 07:42:17 -07:00
cookiejar.cpp Unify the name to 'cookiesFile' everywhere. 2011-09-15 09:40:22 -07:00
cookiejar.h Unify the name to 'cookiesFile' everywhere. 2011-09-15 09:40:22 -07:00
csconverter.cpp support for backtraces (part 2). 2012-03-17 18:40:41 -07:00
csconverter.h Make CSConverter a real singleton. 2011-08-21 00:16:38 -07:00
encoding.cpp [BUGFIX] issue 194: make default encoding UTF-8 2011-08-21 19:48:02 +09:00
encoding.h [BUGFIX] issue 194: make default encoding UTF-8 2011-08-21 19:48:02 +09:00
env.cpp Implement system.env to get system environment variables. 2012-03-15 01:22:17 -07:00
env.h Implement system.env to get system environment variables. 2012-03-15 01:22:17 -07:00
filesystem.cpp Implement fs.readLink to read symlink target. 2012-03-16 20:44:56 -07:00
filesystem.h Implement fs.readLink to read symlink target. 2012-03-16 20:44:56 -07:00
main.cpp Be on the safe side and check for Qt == 4.8.0. 2012-03-15 22:54:13 -07:00
networkaccessmanager.cpp Add support for HTTP request headers modification. 2012-02-19 00:49:28 -08:00
networkaccessmanager.h Add support for HTTP request headers modification. 2012-02-19 00:49:28 -08:00
phantom.cpp Make it possible to print pages with user-defined headers/footers. 2012-04-14 22:04:34 -07:00
phantom.h Make it possible to print pages with user-defined headers/footers. 2012-04-14 22:04:34 -07:00
phantomjs-icon.png Attach the icon the application main widget. 2010-12-26 23:56:44 -08:00
phantomjs.pro Make it possible to print pages with user-defined headers/footers. 2012-04-14 22:04:34 -07:00
phantomjs.qrc Implement the plumbing for CommonJS System module support. 2012-03-14 23:23:43 -07:00
phantomjs_os2.ico Add icon files for Windows and OS/2. 2011-03-18 23:43:45 -07:00
phantomjs_os2.rc Add icon files for Windows and OS/2. 2011-03-18 23:43:45 -07:00
phantomjs_win.ico Add icon files for Windows and OS/2. 2011-03-18 23:43:45 -07:00
phantomjs_win.rc Add icon files for Windows and OS/2. 2011-03-18 23:43:45 -07:00
remote_debugger_harness.html Heavily simplified (and I dare to say: speed up) the way the remote debugger harness is loaded and injected. 2012-01-04 17:24:36 +00:00
repl.cpp support for backtraces (part 2). 2012-03-17 18:40:41 -07:00
repl.h A REPL for PhantomJS 2012-03-04 21:33:08 -08:00
repl.js A REPL for PhantomJS 2012-03-04 21:33:08 -08:00
replcompletable.cpp A REPL for PhantomJS 2012-03-04 21:33:08 -08:00
replcompletable.h A REPL for PhantomJS 2012-03-04 21:33:08 -08:00
system.cpp Implement system.env to get system environment variables. 2012-03-15 01:22:17 -07:00
system.h Implement system.env to get system environment variables. 2012-03-15 01:22:17 -07:00
terminal.cpp Make Terminal class a real singleton. 2011-08-21 00:47:34 -07:00
terminal.h Make Terminal class a real singleton. 2011-08-21 00:47:34 -07:00
usage.txt Remove setting and command-line option for plugins loading. 2012-03-23 07:42:17 -07:00
utils.cpp Correct use of "QT_NO_DEBUG_OUTPUT" and "QT_NO_WARNING_OUTPUT" 2012-03-22 21:14:34 -07:00
utils.h Add option to specify whether or not the remote debugger should autorun. 2012-02-28 07:46:09 -08:00
webpage.cpp Make it possible to print pages with user-defined headers/footers. 2012-04-14 22:04:34 -07:00
webpage.h Make it possible to print pages with user-defined headers/footers. 2012-04-14 22:04:34 -07:00
webserver.cpp Adding Webserver "response.closeGracefully()" to easily (and more elegantly) send empty HTTP responses. 2012-03-23 11:42:16 +00:00
webserver.h Adding Webserver "response.closeGracefully()" to easily (and more elegantly) send empty HTTP responses. 2012-03-23 11:42:16 +00:00