Aymkdn/html-to-pdfmake

Image with hyperlink

ankeshp03 opened this issue · 3 comments

Can we have a feature to add hyperlink to image, if possible?
It is supported by pdfmake as well.
You can find the working code for pdfmake below.

var dd = {
  "content": [
    {
      "nodeName": "IMG",
      "image": "img_ref_0",
      "link": "https://picsum.photos/seed/picsum/200",
      "style": [
        "html-img"
      ]
    }
  ],
  "images": {
    "img_ref_0": "https://picsum.photos/seed/picsum/200"
  },
  "styles": {}
  }
}

It would be a great help if this feature is made available.

I'll have a look tomorrow morning. It's already the evening here and I'm off the computer 😉

Sure 🙂

I published the v2.4.15 where an image inside a link is now getting the link property.

So, the HTML should look like the below to have a link property on the image:

<a href="https://picsum.photos/seed/picsum/200"><img src="https://picsum.photos/seed/picsum/200"></a>