{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/5869","labels_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5869/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5869/comments","events_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5869/events","html_url":"https://github.com/mozilla/pdf.js/issues/5869","id":63519930,"number":5869,"title":"Using Pdf.js - simpleviewer : Not able to update the pdf files according to the increment..","user":{"login":"3gwebtrain","id":6211826,"avatar_url":"https://avatars.githubusercontent.com/u/6211826?v=3","gravatar_id":"","url":"https://api.github.com/users/3gwebtrain","html_url":"https://github.com/3gwebtrain","followers_url":"https://api.github.com/users/3gwebtrain/followers","following_url":"https://api.github.com/users/3gwebtrain/following{/other_user}","gists_url":"https://api.github.com/users/3gwebtrain/gists{/gist_id}","starred_url":"https://api.github.com/users/3gwebtrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3gwebtrain/subscriptions","organizations_url":"https://api.github.com/users/3gwebtrain/orgs","repos_url":"https://api.github.com/users/3gwebtrain/repos","events_url":"https://api.github.com/users/3gwebtrain/events{/privacy}","received_events_url":"https://api.github.com/users/3gwebtrain/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mozilla/pdf.js/labels/1-other","name":"1-other","color":"DDDDDD"},{"url":"https://api.github.com/repos/mozilla/pdf.js/labels/4-information-requested","name":"4-information-requested","color":"0b02e1"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-22T10:33:37Z","updated_at":"2015-03-23T10:18:12Z","closed_at":null,"body":"I would like to show the page according to the `next` and `previous` arrows. for that, I am calling a function to update the pdf files. It works only once the next time nothing updates in the pdf view. my URL get updated each time the user clicks\r\nexample : \"pdfs/aspire1.pdf\", \"pdfs/aspire2.pdf\", \"pdfs/aspire3.pdf\" - like so.\r\nhere is my function :\r\n```javascript\r\nloadPage : function (e, pNo) { //pNo updates like 1,2,3\r\n\t\t\tvar that = this;\r\n\t\t\tvar scale = this.scale;\r\n\t\t\tthis.pNo = pNo;\r\n\t\t\tthis.newPage = pNo+'page';\r\n\r\n\t\t\tthis.pdfUrl =` \"pdfs/aspire\"+pNo+\".pdf\";` //updating the url works fine\r\n\r\n\t\t\tconsole.log(this.pdfUrl); //updates properly.\r\n\r\n\t\t\tvar PAGE_TO_VIEW = 1;\r\n\t\t\tvar SCALE = 0.9;\r\n\r\n\t\t\tPDFJS.getDocument(this.pdfUrl).then(function (pdfDocument) {\r\nconsole.log(this.pdfUrl) //consoles correctly\r\n\t\t\t  return pdfDocument.getPage(PAGE_TO_VIEW).then(function (pdfPage) {\r\n\t\t\t    var pdfPageView = new PDFJS.PDFPageView({\r\n\t\t\t      container: that.pdfContainer.get(0),\r\n\t\t\t      id: PAGE_TO_VIEW,\r\n\t\t\t      scale: SCALE,\r\n\t\t\t      defaultViewport: pdfPage.getViewport(SCALE),\r\n\t\t\t      textLayerFactory: new PDFJS.DefaultTextLayerFactory()\r\n\t\t\t    });\r\n\t\t\t\tpdfPageView.setPdfPage(pdfPage);\r\n\t\t\t\treturn pdfPageView.draw();\r\n\t\t\t  });\r\n\t\t\t});\r\n\t\t},\r\n```\r\n\r\nBut nothing updates in the page. what is wrong here.. any one show me the correct way please?\r\n\r\nI tried both this methods, but no luck:\r\n`\r\n\tPDFViewerApplication.open('pdfs/aspire\"+pNo+\".pdf');\r\n\t\t\tPDFView.open('pdfs/aspire\"+pNo+\".pdf');\r\n`"},"comment":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/comments/84932626","html_url":"https://github.com/mozilla/pdf.js/issues/5869#issuecomment-84932626","issue_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5869","id":84932626,"user":{"login":"Snuffleupagus","id":2692120,"avatar_url":"https://avatars.githubusercontent.com/u/2692120?v=3","gravatar_id":"","url":"https://api.github.com/users/Snuffleupagus","html_url":"https://github.com/Snuffleupagus","followers_url":"https://api.github.com/users/Snuffleupagus/followers","following_url":"https://api.github.com/users/Snuffleupagus/following{/other_user}","gists_url":"https://api.github.com/users/Snuffleupagus/gists{/gist_id}","starred_url":"https://api.github.com/users/Snuffleupagus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Snuffleupagus/subscriptions","organizations_url":"https://api.github.com/users/Snuffleupagus/orgs","repos_url":"https://api.github.com/users/Snuffleupagus/repos","events_url":"https://api.github.com/users/Snuffleupagus/events{/privacy}","received_events_url":"https://api.github.com/users/Snuffleupagus/received_events","type":"User","site_admin":false},"created_at":"2015-03-23T10:18:12Z","updated_at":"2015-03-23T10:18:12Z","body":"Please make sure that you read: https://github.com/mozilla/pdf.js/blob/master/CONTRIBUTING.md; from which I'm quoting the relevant part for this issue:\r\n> If you are developing a custom solution, first check the examples at https://github.com/mozilla/pdf.js#learning and search existing issues. If this does not help, please prepare a short well-documented example that demonstrates the problem and make it accessible online on your website, JS Bin, GitHub, etc. before opening a new issue or contacting us on the IRC channel -- keep in mind that just code snippets won't help us troubleshoot the problem."}}