{"action":"created","issue":{"url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/2381","labels_url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/2381/labels{/name}","comments_url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/2381/comments","events_url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/2381/events","html_url":"https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2381","id":80818018,"number":2381,"title":"Sometime footer show and show time not show wkhtmltopdf","user":{"login":"umairali","id":5318005,"avatar_url":"https://avatars.githubusercontent.com/u/5318005?v=3","gravatar_id":"","url":"https://api.github.com/users/umairali","html_url":"https://github.com/umairali","followers_url":"https://api.github.com/users/umairali/followers","following_url":"https://api.github.com/users/umairali/following{/other_user}","gists_url":"https://api.github.com/users/umairali/gists{/gist_id}","starred_url":"https://api.github.com/users/umairali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umairali/subscriptions","organizations_url":"https://api.github.com/users/umairali/orgs","repos_url":"https://api.github.com/users/umairali/repos","events_url":"https://api.github.com/users/umairali/events{/privacy}","received_events_url":"https://api.github.com/users/umairali/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-26T06:24:37Z","updated_at":"2015-05-26T22:31:39Z","closed_at":null,"body":"I m trying to add page number in footer this is my code \r\n\r\n\r\n    var pdfInfo = {};\r\n    var x = document.location.search.substring(1).split('&');\r\n    for (var i in x)\r\n    {\r\n        var z = x[i].split('=',2);\r\n        pdfInfo[z[0]] = unescape(z[1]);\r\n    }\r\n    function getPdfInfo() {\r\n        var page = pdfInfo.page || 1;\r\n        var pageCount = pdfInfo.topage || 1;\r\n        document.getElementById('page').innerText = page;\r\n        document.getElementById('topage').innerText = pageCount;\r\n    }\r\n\r\ni m calling this js function on body load onload=\"getPdfInfo()\" but some time footer show and some time not show and some time show on first page and not show on second page\r\n"},"comment":{"url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/comments/105688389","html_url":"https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2381#issuecomment-105688389","issue_url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/2381","id":105688389,"user":{"login":"TomiS","id":33161,"avatar_url":"https://avatars.githubusercontent.com/u/33161?v=3","gravatar_id":"","url":"https://api.github.com/users/TomiS","html_url":"https://github.com/TomiS","followers_url":"https://api.github.com/users/TomiS/followers","following_url":"https://api.github.com/users/TomiS/following{/other_user}","gists_url":"https://api.github.com/users/TomiS/gists{/gist_id}","starred_url":"https://api.github.com/users/TomiS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomiS/subscriptions","organizations_url":"https://api.github.com/users/TomiS/orgs","repos_url":"https://api.github.com/users/TomiS/repos","events_url":"https://api.github.com/users/TomiS/events{/privacy}","received_events_url":"https://api.github.com/users/TomiS/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T22:31:39Z","updated_at":"2015-05-26T22:31:39Z","body":"I experience the same problem with my page counter after upgrading to latest 0.12.2.1 version.\r\n````\r\n<!DOCTYPE html>\r\n<html>\r\n    <head>\r\n        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\r\n        <script>\r\nvar pdfInfo = {};\r\nvar x = document.location.search.substring(1).split('&');\r\nfor (var i in x)\r\n{\r\n    var z = x[i].split('=',2);\r\n    pdfInfo[z[0]] = unescape(z[1]);\r\n}\r\nfunction getPdfInfo() {\r\n    var page = pdfInfo.page || 1;\r\n    var pageCount = pdfInfo.topage || 1;\r\n    document.getElementById('footer-page').innerText = page;\r\n    document.getElementById('footer-total').innerText = pageCount;\r\n};\r\n        </script>\r\n    </head>\r\n    <body onload=\"getPdfInfo();\">\r\n        <p class='pagenum'>\r\n            Page <span id=\"footer-page\"></span>/<span id=\"footer-total\"></span>\r\n        </p>\r\n    </body>\r\n</html>\r\n````\r\nWith that code, only the footer of the first page is visible (with correct page number). All footers from page 2 to up are hidden. I also tested that footers work correctly if I remove all javascript from the example so it must be related to scripts."}}