addImage produces an blur or too low quality image in the pdf
I am using the latest version of jsPDF 1.2.61, While adding an image it adds an blur image even though the image is of high quality, if I the same base64 in on-line decoder it produces the perfect image as the original, but the base64 produces low quality when I use addImage functionality of jsPDF.
Snippet:
var doc = new jsPDF('landscape');
var Imagebase64=null;
doc.setFontSize(20);
doc.text(35, 25, "GoodYear");
var Imagebase64='data:image/jpeg;base64,/
I'm seeing the same thing. I just migrated to 1.2.61 from 1.0.272 (I didn't change anything else in my code) and images and texts drawn on canvas get very blurred when it gets pushed to pdf. This seems different then my previous results.
Canvas in browser.

PDF extract.

The pixel mapping from canvas to pdf seems off a bit. Oh, and for reference: each of those top 'tick' marks is spaced exactly 1" from each other.
Don't get me wrong, this is an awesome product, and I'm more than grateful. I will say with this many open issues, I'm feeling mighty guilty for not pitching in and trying to close out an item or two. I will say I found this product pretty confusing on the code side.
And for reference, here's the actual site. Its something custom bike frame manufacturers or custom off-road hobbyists would use. http://dogfeatherdesign.com/ttn_js
Same problem here when adding an image from a canvas. I can confirm that image quality looks good in 1.0.272, but is very poor in 1.2.61. I see the issue for both PNG and JPG.
I'm too getting the same issue.
confirmed in 1.2.61, but only for PNG, JPEG quality is ok but with black background:
the png in 1.0.272 looks like:

the png in 1.2.61 looks like:

the jpeg in 1.2.61 looks like:

Same issue here, good quality on 1.0.272 and average/low quality on 1.2.61, both JPG as PNG.
in prerelease 1.1.135, the quality is ok
Same issue on 1.2.61
+1 Same issue for me
Use below code, it will help you in clearing blur image:
$scope.doc.internal.scaleFactor = 1.55;
@bhavik4748 tested with the line, the image quality is slightly improved, but still very poor(aliasing), can not be used in production.

Anyway many thanks.
same issue for me on 1.2.61 @bhavik4748 thanks that really helped, I've found it better to do doc.internal.scaleFactor = 1.33;
try scalefactor of 1.7 or 1.8, image will be small be would be more precise.
Still getting the same problem even after using the scaling line
@Sketched360 ,
notice that you should set right mimetype for the images ("image/jpeg" , "image/png")
I debugged versions 1 and 2 side by side, and came to the conclusion that this is caused by an undocumented change to the jsPDFAPI.arrayBufferToBinaryString function (line 4267 in the jspdf.debug.js). In this function, the following lines have been added:
if('TextDecoder' in window){ var decoder = new TextDecoder('ascii'); return decoder.decode(buffer); }
Commenting these out and the correct way of rendering the PNG is restored. I'm not sure why it's in there, or why it causes this problem, but at least there's a workaround.
@jalgithub Nice find. Thanks!
@jalgithub thx. Work fine
@bhavik4748 where do I insert that line of code? in jspdf.debug.js or in my own code?
@burtontanner Read my comment above to properly restore the old working.
@jalgithub Those lines are commented out in the version of jspdf that I have and the final image is still blurry. I am just searching to see if there is anything else that I can do.