Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

88
Vistas
Download PDF from link and display it

I have backend link which I click (or pass it to tag) it starts downloading. How can I display i? I dont want users to be able to download it, just want to display it in my react component.

I already tried something like this:

   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])

and then i tried to display it by

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

but it doesnt seems to work..

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda