Search code examples
javascriptjquerypdfcropjspdf

jsPDF low quality image exporting


So I am using a cool tool called cropit to crop images. Now I am trying to get the cropped image exported in a PDF file, using jsPDF.

You can check the editor here: http://code.reloado.com/ecagos3/edit#html,live

(The PDF downloading part wont work, but by downloading the code an trying it out in localhost should be fine I guess)

The PDF file gets generated, but the quality of the image is just awful. You can check it out here: https://www.docdroid.net/KgJbYjk/test.pdf.html

Here is the original image: https://i.sstatic.net/4b9Fy.jpg

Does someone know a solution for getting the normal output, or why this issue happened? Thanks in advance!


Solution

  • I've found the solution via a PHP library. It's called - mPDF