You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 11, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 11, 2020. It is now read-only.
Hi All,
I have a Feature request to make and looking for the workaround at the moment too.
Issue: Adding png adds to the size of pdf as well as adds to the load time of the webpage.
I'm using jspdf for generating pdf from the visualization (d3 graph and images and text) over the web portal I'm working on. and most of my images are webp images.
Currently, addImage does not support adding Webp images to the pdf as I can see, usually, the websites or web portals use webp images to reduce the load time of the webpage.
It would be nice to have if the library can support and a big help if anyone can help me with the workaround at the moment.
I'm trying this nice library webp-converter may be others have better ideas to share.
The upstream project (https://github.com/MrRio/jsPDF) recently got support for Webp images. We merged the features of this fork into the upstream repository some time ago and yWorks is now co-maintainer of the original project, which is why this repository will soon be archived. MrRio/jsPDF will soon get a new release that will also support Webp images.
@HackbrettXXX , Thanks for getting back on this. When is the next release planned? and is there any suggestion by which I can reduce the size of the pdf. I've lot of tags and logos that combine together in the pdf that needs to export.
There is no fixed release date, yet. Probably within the next weeks.
You can turn on by passing compress: true to the jsPDF options, but this won't help much if your PDF mainly consists of images. If your images originate from vector graphics, you can add them using svg2pdf. If not, your only option is to compress your images as much as possible. Currently, you can use JPEG images for this. In the future WebP. Note, though, that WebP is also converted to JPEG internally. AFAIK, the PDF standard does not support WebP image de-/encoding.
Activity
HackbrettXXX commentedon Jul 22, 2020
The upstream project (https://github.com/MrRio/jsPDF) recently got support for Webp images. We merged the features of this fork into the upstream repository some time ago and yWorks is now co-maintainer of the original project, which is why this repository will soon be archived. MrRio/jsPDF will soon get a new release that will also support Webp images.
Prat041192 commentedon Jul 27, 2020
@HackbrettXXX , Thanks for getting back on this. When is the next release planned? and is there any suggestion by which I can reduce the size of the pdf. I've lot of tags and logos that combine together in the pdf that needs to export.
HackbrettXXX commentedon Jul 27, 2020
There is no fixed release date, yet. Probably within the next weeks.
You can turn on by passing
compress: trueto the jsPDF options, but this won't help much if your PDF mainly consists of images. If your images originate from vector graphics, you can add them using svg2pdf. If not, your only option is to compress your images as much as possible. Currently, you can use JPEG images for this. In the future WebP. Note, though, that WebP is also converted to JPEG internally. AFAIK, the PDF standard does not support WebP image de-/encoding.