mercredi 22 mai 2019

Cannot read property 'inlineReference' of undefined in rasterizeHTML from jspdf

I'm using jspdf to render HTML to PDF in an Ember app. jspdf is included using the ember-js-pdf plugin, which is getting me jspdf v1.5.3. html2canvas seems to have recently moved to a promise-based model which jspdf isn't ready for, so I tried rasterizeHTML.js instead. Once I made it available in the app by adding

  app.import('node_modules/rasterizehtml/dist/rasterizeHTML.js');

I'm able to build, but then when I print I get this error:

Uncaught TypeError: Cannot read property 'inlineReferences' of undefined
at Object.module.rasterize (rasterizeHTML.js:1009)
at Object.module.drawDocument (rasterizeHTML.js:1081)
at Object.jsPDFAPI.addHTML (jspdf.debug.js:15833)

...and at that point, uh?

It looks like rasterizeHTML is looking for any inline assets to retrieve and include, and not finding any? Is this a bug in rasterizeHTML?




Aucun commentaire:

Enregistrer un commentaire