Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Support for webp images #36

Open
Open

Description

@Prat041192

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.

Thanks in advance,

Activity

  1. HackbrettXXX commented on Jul 22, 2020

    @HackbrettXXX
    Member

    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.

  2. Prat041192 commented on Jul 27, 2020

    @Prat041192
    Author

    @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.

  3. HackbrettXXX commented on Jul 27, 2020

    @HackbrettXXX
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions