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

148
Views
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
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!