Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

475
Views
Why can't I get a image (base64 string) to display

I am having a bit of trouble getting an Image to display. While normally, I would display the image like this:

<img src={"data:image/png;base64," + data.image} id="logoImg" />

... where data.image is a base64 string. However, this gives me no error but I never see the logo on the pdf:

<Image style={styles.logo} src={{ data: "image/png;base64," + data.image}} />

Any help would be appreciated.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

  1. Original Image was a jpeg
  2. I had to put it in a buffer first.
const buff = new Buffer(data.image, 'base64');
...
<Image style={styles.logo} src={{ data: buff, format: 'jpg' }} />
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!