Limit the size of canvases to 5MP (iOS restriction)

This commit is contained in:
Samuel Chantaraud 2014-05-23 21:43:43 -04:00
parent 06cdca4576
commit 952545e20f
4 changed files with 51 additions and 5 deletions

View file

@ -507,3 +507,12 @@ if (typeof PDFJS === 'undefined') {
window.setTimeout(callback, 20);
});
})();
(function checkCanvasSizeLimitation() {
var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent);
var isAndroid = /Android/g.test(navigator.userAgent);
if (isIOS || isAndroid) {
// 5MP
PDFJS.maxCanvasPixels = 5242880;
}
})();