question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Saving PDF with image fails

See original GitHub issue

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)

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
mvanrooncommented, Mar 22, 2016

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

1reaction
MrRiocommented, Sep 26, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Insufficient data for an image in Acrobat or Acrobat Reader
When you open a PDF file in Acrobat or Acrobat Reader, the following error message is displayed: “Insufficient data for an image.
Read more >
"Save as PDF" not showing all images. - Microsoft Community
Hi, I am using Excel and I want to use the "File > Save as PDF" feature. It used to work just fine....
Read more >
Why Is Save As PDF Not Working? Here's How To Fix It
Fix PDF Save As Not Working on Adobe Acrobat · Disable Show Online Storage Options · Disable the Web Browser Options · Run...
Read more >
Broken images in PDF export | Confluence
The problem occurs due to the application software that created the image file. Somehow, the PDF export function is unable to render that ......
Read more >
Export to PDF: Problem with masked images in a shape
A temporary fix is to do what Andrew Johnson said below. Save PDF from XD. Right click PDF-file and choose "Open with..." and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found