I have a code that lets me execute a PDF file on a page. The link in the var is executed by a function.
var url = 'myurl.com';
pdfjsLib.getDocument('https://api.codetabs.com/v1/proxy?quest=' + url).promise.then(function(pdfDoc_) {
pdfDoc = pdfDoc_;
pages = parseInt(pdfDoc.numPages);
var canvasHtml = '';
for (var i = 0; i < pages; i++) {
canvasHtml += '<canvas id="canvas_' + i + '"></canvas>';
}
I want to create buttons that replace the link in the var URL. So I can load different PDF's inside the same page.