PDF links, downloads and embeds
Explore PDF links, downloads and embedded previews in regular DOM, nested iframes and shadow roots.
How these examples work
Open PDF serves the file inline. Your browser may display it in a PDF viewer or download it, depending on its settings. Download PDF serves the same file as an attachment.
Embedded previews use iframe elements. Each file URL includes a case parameter identifying the example; the PDF contents are the same in every case.
1. Plain page
Open PDF: baselineDownload PDF: baseline
Plain text in the baseline example. This paragraph does not link to a file.
2. Link and PDF inside an iframe
3. Two iframe levels → link and PDF
4. Open Shadow DOM → link and PDF
5. Open Shadow DOM → iframe → link and PDF
6. Iframe → open Shadow DOM → link and PDF
7. Closed Shadow DOM
The content is rendered inside a closed shadow root. Its host.shadowRoot property returns null.