{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/6594","labels_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6594/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6594/comments","events_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6594/events","html_url":"https://github.com/mozilla/pdf.js/issues/6594","id":115376241,"number":6594,"title":"Images in PDF disappear when there is another canvas context","user":{"login":"sid-thakur","id":5922613,"avatar_url":"https://avatars.githubusercontent.com/u/5922613?v=3","gravatar_id":"","url":"https://api.github.com/users/sid-thakur","html_url":"https://github.com/sid-thakur","followers_url":"https://api.github.com/users/sid-thakur/followers","following_url":"https://api.github.com/users/sid-thakur/following{/other_user}","gists_url":"https://api.github.com/users/sid-thakur/gists{/gist_id}","starred_url":"https://api.github.com/users/sid-thakur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sid-thakur/subscriptions","organizations_url":"https://api.github.com/users/sid-thakur/orgs","repos_url":"https://api.github.com/users/sid-thakur/repos","events_url":"https://api.github.com/users/sid-thakur/events{/privacy}","received_events_url":"https://api.github.com/users/sid-thakur/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":3,"created_at":"2015-11-05T21:14:33Z","updated_at":"2015-11-05T22:58:29Z","closed_at":null,"body":"Images in PDF disappear if I enable another canvas context, which I am using for a D3.js word cloud visualization that creates its own canvas on the fly and exports it to d3.layout namespace. Screen shot of symptoms shown at end.\r\n\r\nSpecifically, turning on the lines below at end of the following code block cause images to disappear:\r\n\r\n```\r\n  //c.fillStyle = \"red\";\r\n  //c.strokeStyle = \"red\";\r\n```\r\n```\r\n  if (typeof document !== \"undefined\") {\r\n\tconsole.log ('\\t > standard DOM canvas');\r\n    canvas = document.createElement(\"canvas\");\r\n    canvas.width = 1;\r\n    canvas.height = 1;\r\n    ratio = Math.sqrt(canvas.getContext(\"2d\").getImageData(0, 0, 1, 1).data.length >> 2);\r\n    canvas.width = (cw << 5) / ratio;\r\n    canvas.height = ch / ratio;\r\n  } else {\r\n\tconsole.log ('\\t > node canvas');\r\n  \r\n    // node-canvas support\r\n    var Canvas = require(\"canvas\");\r\n    canvas = new Canvas(cw << 5, ch);\r\n  }\r\n\r\n  var c = canvas.getContext(\"2d\"),\r\n      spirals = {\r\n        archimedean: archimedeanSpiral,\r\n        rectangular: rectangularSpiral\r\n      };\r\n  c.fillStyle = \"red\";\r\n  c.strokeStyle = \"red\";\r\n  c.textAlign = \"center\";\r\n  exports.cloud = cloud;\r\n```\r\n\r\n![pdsjs_image_issue](https://cloud.githubusercontent.com/assets/5922613/10981792/c59a8a96-83d7-11e5-8f93-4e15a8c5c220.png)\r\n\r\nWhat is going on here? Is there a way to isolate the canvas contexts from interfering with one another?\r\n\r\nThanks!\r\nSid"},"comment":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/comments/154222566","html_url":"https://github.com/mozilla/pdf.js/issues/6594#issuecomment-154222566","issue_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6594","id":154222566,"user":{"login":"yurydelendik","id":1523410,"avatar_url":"https://avatars.githubusercontent.com/u/1523410?v=3","gravatar_id":"","url":"https://api.github.com/users/yurydelendik","html_url":"https://github.com/yurydelendik","followers_url":"https://api.github.com/users/yurydelendik/followers","following_url":"https://api.github.com/users/yurydelendik/following{/other_user}","gists_url":"https://api.github.com/users/yurydelendik/gists{/gist_id}","starred_url":"https://api.github.com/users/yurydelendik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurydelendik/subscriptions","organizations_url":"https://api.github.com/users/yurydelendik/orgs","repos_url":"https://api.github.com/users/yurydelendik/repos","events_url":"https://api.github.com/users/yurydelendik/events{/privacy}","received_events_url":"https://api.github.com/users/yurydelendik/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T22:58:28Z","updated_at":"2015-11-05T22:58:28Z","body":"It's hard to provide any input without seeing the code run. Re-creating the test case you already have locally by the project contributors is a waste of time. Please make your test case or example available to speed up the issue resolution."}}