react-native-html-to-pdf icon indicating copy to clipboard operation
react-native-html-to-pdf copied to clipboard

How to add <img> html tag with local image in RN project folder?

Open Lucas-Perazzo opened this issue 1 year ago • 4 comments

I am creating a pdf and I need to use an image that I have saved in my project. I use the img tag but it doesn't show anything, the only solution I found is to use a

with a background image but only if it is a url not with local images. Can you help me?

Lucas-Perazzo avatar Aug 23 '23 19:08 Lucas-Perazzo

Have you got any solution ?

MTPL0005-AbhishekDube avatar Nov 10 '23 07:11 MTPL0005-AbhishekDube

I managed to get custom fonts and images working by using base64 formatted assets

jeroen-van-dijk avatar Dec 04 '23 18:12 jeroen-van-dijk

Any one has any idea to resolve this issue?

Aswin-Inigo avatar Aug 05 '24 02:08 Aswin-Inigo

just do something like this

<img src="${ Image.resolveAssetSource( require('assets/images/apple.png'), ).uri }" />

and import Image from react-native import {Image} from 'react-native';

WilliamOchy avatar Aug 30 '24 13:08 WilliamOchy