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

160
Vistas
Open PDF from URL in the new browser tab for printing

I'm trying to open the PDF file for printing from captured url. I have tried window.open and pass the PDF url variable but the browser keeps downloading that PDF instead of opening in new tab, or opening in the Acrobat or for printing.

Then I have tried something like that:

On my source page:

<button onclick = "openForPrinting()" value = "Display">Print PDF</button>

my JS code:

var pdfFileUrl = url;

function openForPrinting()
{   
   myWindow=window.open("pdfwebpage.html");
   myWindow.close; 
}

And I have a new html page titled pdfwebpage.html

<html>
<head>    
</head>

   <body onload="window.print()">
   <embed src=pdfFileUrl/>   How to pass the PDF URL path here from the openForPrinting() function?

</body>
</html>

This almost worked, although I don't know how to pass the PDF url (pdfFileUrl) to the pdfwebpage.html page to be embedded.

Thanks for help.

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