mozilla/pdf.js — Issue #984: Uncaught Error: HIERARCHY_REQUEST_ERR: DOM Exception 3
Author: ontologiae
Created: 2011-12-28 15:44:41+00:00
State: open

Context : Chrome and Firefox. Using Pdf.js built by make in the repository

in the index.html we have (inside

):

We load the pdf with this code :

function loadPDF() {
//with a pdf file accessed by http, same error
PDFJS.getPdf('papier_a_entete_cowebo.pdf', function getPdfHelloWorld(data) {
//
// Instantiate PDFDoc with PDF data
//
var pdf = new PDFJS.PDFDoc(data);
var page = pdf.getPage(1);
var scale = 1.5;

//
// Prepare canvas using PDF page dimensions
//
var canvas = document.getElementById('the-canvas');
var context = canvas.getContext('2d');
canvas.height = page.height * scale;
canvas.width = page.width * scale;

//
// Render PDF page into canvas context
//
page.startRendering(context);
});
}

We got :

pdf.js:14495Uncaught Error: HIERARCHY_REQUEST_ERR: DOM Exception 3
font_bindDompdf.js:14495
fontLoaderBindpdf.js:12835
pageEnsureFontspdf.js:235
pageStartRenderingFromIRQueuepdf.js:198
pdfDocPagepdf.js:654
messageHandlerComObjOnMessagepdf.js:26855