jsPDF: Saving PDF with image fails

Create a ticket with an image, it will fail on the following line:

var datauri = ('' + type).substr(0, 6) === 'dataur'
                    ? 'data:application/pdf;base64,' + btoa(buildDocument()) : 0;

With the error:

Error: Error in function Error (native): Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
    at Console.$window.console.error (http://localhost:3333/App/Business/AngularErrorHandler.js:43:23)
    at Object.__safeCallWrapper [as output] (http://localhost:3333/Scripts/jsPDF/jspdf.js:471:44)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 15 (4 by maintainers)

Most upvoted comments

Same problem here. Only fails on png’s for me.