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

442
Views
convert base64 pdf src string to url which can be used in img src

i have a base64 pdf response from api something as:

const res = 'JVBERi0xLjQKJeLjz9MKNCAwIG9iago8PC9GaWx0ZXIvRmxhdGVEZWNvZGUvTGVuZ3RoIDQ1MD4+c3RyZWFtCnicrVTNctowEL7' 

I am trying to convert it to image src as follows:

<img src={`data:application/pdf;base64,${res}`} alt='not found'/>

But getting alt text only and the response is also correct.But when i am using it in

<embed src={`data:application/pdf;base64,${res}`} type="application/pdf" />

it works fine with embed. How can i change the base64 string to url which supports.And how can i print it after preview.

about 4 years ago · Juan Pablo Isaza
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!