{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/6212","labels_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6212/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6212/comments","events_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6212/events","html_url":"https://github.com/mozilla/pdf.js/issues/6212","id":95157784,"number":6212,"title":"Embedding into webpage","user":{"login":"frederikbosch","id":1552577,"avatar_url":"https://avatars.githubusercontent.com/u/1552577?v=3","gravatar_id":"","url":"https://api.github.com/users/frederikbosch","html_url":"https://github.com/frederikbosch","followers_url":"https://api.github.com/users/frederikbosch/followers","following_url":"https://api.github.com/users/frederikbosch/following{/other_user}","gists_url":"https://api.github.com/users/frederikbosch/gists{/gist_id}","starred_url":"https://api.github.com/users/frederikbosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frederikbosch/subscriptions","organizations_url":"https://api.github.com/users/frederikbosch/orgs","repos_url":"https://api.github.com/users/frederikbosch/repos","events_url":"https://api.github.com/users/frederikbosch/events{/privacy}","received_events_url":"https://api.github.com/users/frederikbosch/received_events","type":"User","site_admin":false},"labels":[{"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":2,"created_at":"2015-07-15T10:19:42Z","updated_at":"2015-07-15T10:44:43Z","closed_at":null,"body":"Because I want to control how a pdf open in a specific webpage, I am using pdf.js (pdf.js dist combined version 1.1.299). However, I have troubles opening some files. For those files I have the same log messages.\r\n\r\nFor Firefox it says.\r\n`\"Warning: Unsupported feature \"font\"\"`\r\n`\"Warning: Error during font loading: glyphName is undefined\"`\r\n\r\nWhereas Chrome says.\r\n`Refused to get unsafe header \"Accept-Ranges\"`\r\n`Warning: Unsupported feature \"font\"`\r\n`Warning: Error during font loading: Cannot read property '0' of undefined`\r\n\r\nSince all the documents are client documents, I cannot link/upload them. But my general feeling that my setup of PDF JS is incorrectly. The pdf is rendering correctly when I access the PDF normally with the Firefox (which uses PDF JS natively, right?). So it must be in my setup on the library. Please find some code below (it is an [EmberJS](http://emberjs.com/) component).\r\n\r\n```js\r\nApp.PdfViewerComponent = Ember.Component.extend({\r\n\r\n  classNames: ['overlay', 'pdf'],\r\n\r\n  disableWorker : function () {\r\n    PDFJS.disableWorker = true;\r\n  }.on('init'),\r\n\r\n  renderPdf : function () {\r\n    var href = settings.host + '/stream/pdf?url=' + encodeURIComponent(this.get('href'));\r\n    var $container = this.$();\r\n    var $canvas = this.$('canvas');\r\n    var canvas = $canvas.get(0);\r\n\r\n    $container.append($canvas);\r\n    $container.addClass('loading');\r\n\r\n    var self = this;\r\n    PDFJS.getDocument(href).then(function (pdfDoc) {\r\n      self.set('document', pdfDoc);\r\n      self.set('page', 1);\r\n      self.renderPdfPage(canvas);\r\n    });\r\n  }.on('didInsertElement'),\r\n\r\n  renderPdfPage : function (canvas) {\r\n    var $container = this.$();\r\n    var pdfDoc = this.get('document');\r\n    var page = this.get('page');\r\n\r\n    $container.addClass('loading');\r\n\r\n    pdfDoc.getPage(page).then(function (page) {\r\n      var viewport = page.getViewport(1.5);\r\n      var context = canvas.getContext('2d');\r\n\r\n      canvas.height = viewport.height;\r\n      canvas.width = viewport.width;\r\n\r\n      $container.removeClass('loading');\r\n\r\n      page.render({\r\n        canvasContext: context,\r\n        viewport: viewport\r\n      });\r\n    });\r\n  }\r\n\r\n});\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/comments/121572750","html_url":"https://github.com/mozilla/pdf.js/issues/6212#issuecomment-121572750","issue_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6212","id":121572750,"user":{"login":"timvandermeij","id":1993262,"avatar_url":"https://avatars.githubusercontent.com/u/1993262?v=3","gravatar_id":"","url":"https://api.github.com/users/timvandermeij","html_url":"https://github.com/timvandermeij","followers_url":"https://api.github.com/users/timvandermeij/followers","following_url":"https://api.github.com/users/timvandermeij/following{/other_user}","gists_url":"https://api.github.com/users/timvandermeij/gists{/gist_id}","starred_url":"https://api.github.com/users/timvandermeij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timvandermeij/subscriptions","organizations_url":"https://api.github.com/users/timvandermeij/orgs","repos_url":"https://api.github.com/users/timvandermeij/repos","events_url":"https://api.github.com/users/timvandermeij/events{/privacy}","received_events_url":"https://api.github.com/users/timvandermeij/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T10:44:43Z","updated_at":"2015-07-15T10:44:43Z","body":"(By the way, you might also want to use the web components at https://github.com/mozilla/pdf.js/tree/master/examples/components for your implementation. It allows you to set up a minimal viewer with just a few files of code.)"}}