页眉中的PhantomJS部分名称

我正在使用PhantomJS将HTML呈现为PDF。 这是相当不错的工具。

它允许在页眉中放置html。 并允许用当前页面的编号replace一些像pageNum这样的模板variables。

但现在我需要在页面标题中放一些“Section header”,以便在每一页显示当前的章节名称。

例如:

=====Page 1. Chapter: Quick start===== <h1>Quick start</h1> Some text about quick start =====Page 2. Chapter: Quick start===== Some text about quick start =====Page 3. Chapter: Installation===== <h1>Installation</h1> Some text about installation =====Page 2. Chapter: Installation===== Some text about installation ==== 

其他一些工具,如wkhtmltopdf,允许这样做。 wkhtmltopdf将[部分] var传递给头文件。

但在PhantomJS中如何做到这一点?