• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

225
Vistas
JS How to get PDF from URL and save to a variable

I have a link. If it is executed in a browser it triggers PDF-file downloading. I want to get this file in JS from this link and store it to a variable. Is it possible?

almost 3 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Yes, you can do it. For example, you can store the pdf into the blob (file-like object). https://developer.mozilla.org/en-US/docs/Web/API/Blob

const url = 'your link to the PDF'

let pdf;

fetch(url)
  .then(response => response.blob())
  .then(blob => {
    pdf = blob
  })
almost 3 years ago · Juan Pablo Isaza Denunciar
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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda