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.

Hello -

So jsPDF is working wonderfully. However when I use addImage to add a .png image to the pdf, I am getting inconsistent results in terms of the color of the .png being added. This is how I am adding it:

doc.addImage(newimgData, 'png', 0.7, 3.4, updatedImgwidth, updatedImgheight);

This is what should be coming through:

screen shot 2016-05-10 at 4 55 11 pm

However, this is what gets added to the pdf:

screen shot 2016-05-10 at 4 54 54 pm

Notice how the blue turns to black? All kinds of incorrect colors. Anyone have any ways to fix this?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
woodccccommented, Dec 7, 2017

Faced same issue too. Finally find pdfmake can replace jsPDF.So,hope it can help some one!

2reactions
ragiercommented, May 18, 2016

It’s seems to be in relation with this topic . But still no online solution…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Color is wrong when a PNG image is placed on the same ...
It is an issue with Photoshop. Acrobat is just where I see the problem. You can see the color space ends up just...
Read more >
wrong colors with PNG import since AfterEffects 17.7.0
Since AfterEffects 17.7.0 the colors of PNG files will be shown not correctly. It seems the the PNGImporter ignores the colormanagement of ...
Read more >
Why png image loses color? - Graphic Design Stack Exchange
According to the OP, the image was created with CMYK colors in Illustrator, and saved as PNG. But PNG format does NOT support...
Read more >
Prevent color problems when saving in PNG or JPEG2000 ...
In this tutorial, I talk about using both the PNG and JPEG2000 image formats, and how to work with those in Photoshop without...
Read more >
The PNG color problem - CSS HTML Validator Support
Mike Gale found this great link on PNG's and color issues. ... There is no way of making PNG images that match CSS...
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