Copy link to clipboard
Copied
For last few days I am searching how to open different PDF files in one embedded pdf window, on the same page.
I want to use hyperlinks to open in an embedded pdf in html without changing the page. I would like to use it like that, when I click on hiperlink to pdf on the page to open one PDF file in embedded pdf and than when I click on a next hiperlink to open in the same embedded pdf on the same page.
The easiest way would be to use an HTML Iframe and change the source of the iframe using the target attribute in the link's <a> tag. This will work, with one big caveat, no matter what you do with iframes, modal windows or javascripts to get multiple PDF files to show the way you describe, the user's browser settings can easily override your embedding methods.
As developers, we really don't get to decide exactly how media files like PDFs are displayed. If the viewer of your site has "Open PDFs i
...Copy link to clipboard
Copied
The easiest way would be to use an HTML Iframe and change the source of the iframe using the target attribute in the link's <a> tag. This will work, with one big caveat, no matter what you do with iframes, modal windows or javascripts to get multiple PDF files to show the way you describe, the user's browser settings can easily override your embedding methods.
As developers, we really don't get to decide exactly how media files like PDFs are displayed. If the viewer of your site has "Open PDFs in Acrobat" as their default setting, it will download and open in their Acrobat program leaving the webpage with a broken appearance (blank white space next to links).
Because of the limitations like this, many sites will simply link to the PDF file as if it were another page of the website. For those users who have their browser set to open the file, the browser will open it. For those who don't the file will download and open in Acrobat, rather than showing a "broken" web page.
Copy link to clipboard
Copied
Thank you very much
Copy link to clipboard
Copied
You realize browsers are systematically phasing out support for plugins that open embedded PDFs and other media types inside the browser. Depending on your visitors' user-settings, it's very likely they won't be able to interact with the PDF unless it's opened directly in Acrobat Pro or Acrobat Reader.
https://www.fxsitecompat.com/en-CA/docs/2016/plug-in-support-has-been-dropped-other-than-flash/
For usability reasons, I think it's best to provide a direct link to the PDF, inform users what it is (PDF 20KB) and let them decide how best to handle it. Also, some mobile & tablet users don't have PDF readers on their devices. Is there some reason you must use PDFs instead of mainstream web files -- HTML, SVG, JPG?
Nancy