Render .pdf to single Canvas using pdf.js and ImageData
I am trying to read an entire .pdf Document using PDF.js and then render all the pages on a single canvas. My idea: render each page onto a canvas and get the ImageData (context.getImageData()), clear the canvas do the next page. I store all the ImageDatas in an array and once all pages are in there I want to put all the ImageDatas from the array onto a single canvas. var pdf = null; PDFJS.disableWorker = true; var pages = new Array(); //Prepare some things var canvas = document.getElementById('cv'); var context = canvas.getContext('2d'); var scale = 1.5; PDFJS.getDocument(url).then(function