{"action":"created","issue":{"url":"https://api.github.com/repos/VadimDez/ng2-pdf-viewer/issues/148","repository_url":"https://api.github.com/repos/VadimDez/ng2-pdf-viewer","labels_url":"https://api.github.com/repos/VadimDez/ng2-pdf-viewer/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/VadimDez/ng2-pdf-viewer/issues/148/comments","events_url":"https://api.github.com/repos/VadimDez/ng2-pdf-viewer/issues/148/events","html_url":"https://github.com/VadimDez/ng2-pdf-viewer/issues/148","id":253535943,"number":148,"title":"Error : Cannot read property 'getPage' of undefined","user":{"login":"soyiatgit","id":14197878,"avatar_url":"https://avatars3.githubusercontent.com/u/14197878?v=4","gravatar_id":"","url":"https://api.github.com/users/soyiatgit","html_url":"https://github.com/soyiatgit","followers_url":"https://api.github.com/users/soyiatgit/followers","following_url":"https://api.github.com/users/soyiatgit/following{/other_user}","gists_url":"https://api.github.com/users/soyiatgit/gists{/gist_id}","starred_url":"https://api.github.com/users/soyiatgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soyiatgit/subscriptions","organizations_url":"https://api.github.com/users/soyiatgit/orgs","repos_url":"https://api.github.com/users/soyiatgit/repos","events_url":"https://api.github.com/users/soyiatgit/events{/privacy}","received_events_url":"https://api.github.com/users/soyiatgit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2017-08-29T05:48:54Z","updated_at":"2017-11-27T11:22:04Z","closed_at":null,"author_association":"NONE","body":"I keep getting the following error while page rendering:\r\n\r\n`ERROR TypeError: Cannot read property 'getPage' of undefined\r\n    at PdfViewerComponent.webpackJsonp.../../../../ng2-pdf-viewer/dist/pdf-viewer.component.js.PdfViewerComponent.renderPage (pdf-viewer.component.js:142)\r\n    at PdfViewerComponent.webpackJsonp.../../../../ng2-pdf-viewer/dist/pdf-viewer.component.js.PdfViewerComponent.render (pdf-viewer.component.js:118)\r\n    at pdf-viewer.component.js:91\r\n    at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:425)\r\n    at Object.onInvokeTask (core.es5.js:3881)\r\n    at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:424)\r\n    at Zone.webpackJsonp.../../../../zone.js/dist/zone.js.Zone.runTask (zone.js:192)\r\n    at webpackJsonp.../../../../zone.js/dist/zone.js.ZoneTask.invokeTask (zone.js:499)\r\n    at ZoneTask.invoke (zone.js:488)\r\n    at timer (zone.js:1896)`\r\n\r\nAlthough, the pages can still be rendered. I debugged and found the issue to be in the following block:\r\n\r\n`PdfViewerComponent.prototype.renderPage = function (pageNumber) {\r\n        var _this = this;\r\n        return this._pdf.getPage(pageNumber).then(function (page) {\r\n            var viewport = page.getViewport(_this._zoom, _this._rotation);\r\n            var container = _this.element.nativeElement.querySelector('div');\r\n            if (!_this._originalSize) {\r\n                viewport = page.getViewport(_this.element.nativeElement.offsetWidth / viewport.width, _this._rotation);\r\n            }\r\n            if (!_this._showAll) {\r\n                _this.removeAllChildNodes(container);\r\n            }\r\n            return page.getOperatorList().then(function (opList) {\r\n                var svgGfx = new PDFJS.SVGGraphics(page.commonObjs, page.objs);\r\n                return svgGfx.getSVG(opList, viewport).then(function (svg) {\r\n                    var $div = document.createElement('div');\r\n                    $div.classList.add('page');\r\n                    $div.setAttribute('data-page-number', \"\" + page.pageNumber);\r\n                    $div.appendChild(svg);\r\n                    container.appendChild($div);\r\n                });\r\n            });\r\n        });\r\n    };`\r\n\r\nthis._pdf doesn't contain getPages() method. Any suggestions ?"},"comment":{"url":"https://api.github.com/repos/VadimDez/ng2-pdf-viewer/issues/comments/347153518","html_url":"https://github.com/VadimDez/ng2-pdf-viewer/issues/148#issuecomment-347153518","issue_url":"https://api.github.com/repos/VadimDez/ng2-pdf-viewer/issues/148","id":347153518,"user":{"login":"Shafil","id":29542706,"avatar_url":"https://avatars1.githubusercontent.com/u/29542706?v=4","gravatar_id":"","url":"https://api.github.com/users/Shafil","html_url":"https://github.com/Shafil","followers_url":"https://api.github.com/users/Shafil/followers","following_url":"https://api.github.com/users/Shafil/following{/other_user}","gists_url":"https://api.github.com/users/Shafil/gists{/gist_id}","starred_url":"https://api.github.com/users/Shafil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shafil/subscriptions","organizations_url":"https://api.github.com/users/Shafil/orgs","repos_url":"https://api.github.com/users/Shafil/repos","events_url":"https://api.github.com/users/Shafil/events{/privacy}","received_events_url":"https://api.github.com/users/Shafil/received_events","type":"User","site_admin":false},"created_at":"2017-11-27T11:22:04Z","updated_at":"2017-11-27T11:22:04Z","author_association":"NONE","body":"same issue..Not able to view the document...getpage error."}}
{"actor":{"display_login":"Shafil"}}