react-pdf: Image not rendering in react-pdf?
I am using react-pdf. I write one component Named MyDoc-
<Document>
<Page size="A4">
<View style={styles.Header}>
<Image style={styles.image} src="https://jobsicle.org/images/jobseekers/16462432893850.jpg" cache={false} />
<View style={styles.profileNameContainer}>
<Text style={styles.profileName}>Jannat</Text>
<View style={styles.profileDivider} />
<Text style={styles.profileJob}>Full Stack Developer</Text>
</View>
</View>
</Page>
</Document>
Here I am facing problem with rendering image. This is a tricky problem. When I put this url- https://jobsicle.org/images/jobseekers/16462432893850.jpg it do not show the image like flowing.

But when I put this link - https://static.vecteezy.com/packs/media/components/global/search-explore-nav/img/vectors/term-bg-1-666de2d941529c25aa511dc18d727160.jpg in Image src. It works perfectly.

Then what going wrong on the first image. Anybody can help me.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17
Hi, i have the same issue. I dont know how to render the image. I put a url in src but this
<Image src={{ uri: _your_image_url_goes_here_, method: "GET", headers: { "Cache-Control": "no-cache" }, body: "" }} />isn’t working. Someone have a solution?It works for me. <Image src={
${Image Source}} />. add img source in some const and then call it in image source with backticks.@siamahnaf198
A solution which worked for me was the following:
_Originally posted by @himanshusandha in https://github.com/diegomura/react-pdf/issues/929#issuecomment-875626064_
using nextjs 13 appRouter, and this solution worked great thank you!
I am using nextjs 13 and it works fine too even using a local image. I was struggling making it work but it seems that it is a viable solution: My code: