Browse Source

fix [sitepage] and [sitepages] not working without HTML headers/footers

This fixes #1808 and is an update to ebf825cd6b91a11675bbaa570d9d418af900cca2,
which did not handle it for the --{header,footer}-{left,center,right} options.
Ashish Kulkarni 11 years ago
parent
commit
28beaa71e5
2 changed files with 3 additions and 0 deletions
  1. 1 0
      CHANGELOG.md
  2. 2 0
      src/lib/pdfconverter.cc

+ 1 - 0
CHANGELOG.md

@@ -1,6 +1,7 @@
 v0.12.2 (unreleased)
 --------------------
 * **#1758**: fix corrupt image when output is specified as "-" in wkhtmltoimage on Windows
+* **#1808**: fix [sitepage] and [sitepages] not working without HTML headers/footers
 
 v0.12.1 (2014-06-26)
 --------------------

+ 2 - 0
src/lib/pdfconverter.cc

@@ -596,6 +596,8 @@ void PdfConverterPrivate::endPage(PageObject & object, bool hasHeaderFooter, int
 	if (hasHeaderFooter) {
 		QHash<QString, QString> parms;
 		fillParms(parms, pageNumber, object);
+		parms["sitepage"]  = QString::number(objectPage+1);
+		parms["sitepages"] = QString::number(object.pageCount);
 
 		//Webkit used all kinds of crazy coordinate transformation, and font setup
 		//We save it here and restore some sane defaults