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

446
Views
convertir base64 pdf src string a url que se puede usar en img src

tengo una respuesta pdf base64 de api algo como:

 const res = 'JVBERi0xLjQKJeLjz9MKNCAwIG9iago8PC9GaWx0ZXIvRmxhdGVEZWNvZGUvTGVuZ3RoIDQ1MD4+c3RyZWFtCnicrVTNctowEL7'

Estoy tratando de convertirlo a image src de la siguiente manera:

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

Pero obtener solo texto alternativo y la respuesta también es correcta. Pero cuando lo estoy usando en

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

funciona bien con incrustar. ¿Cómo puedo cambiar la cadena base64 a la URL que admite? ¿Y cómo puedo imprimirla después de la vista previa?

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!