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

86
Views
Descargar PDF desde el enlace y mostrarlo

Tengo un enlace backend en el que hago clic (o lo paso para etiquetar) y comienza a descargarse. ¿Cómo puedo mostrar i? No quiero que los usuarios puedan descargarlo, solo quiero mostrarlo en mi componente de reacción.

Ya probé algo como esto:

 async function createFile(url) { let response = await fetch(url); let data = await response.blob(); let metadata = { type: "application/pdf", }; let file = new File([data], "12121.pdf", metadata); return file; } const [file, setFile] = useState(); useEffect(() => { if (pdf) { setFile(createFile(pdf)); } }, [pdf])

y luego traté de mostrarlo por

 <embed src={file} width="800px" height="2100px" />

pero parece que no funciona..

about 4 years ago · Santiago Trujillo
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!