Files
MarvinKrausser.github.io/pdf_viewer.html
T
2026-03-31 23:42:20 +02:00

26 lines
728 B
HTML

<!DOCTYPE html>
<html><head>
<link rel="icon" href="images/generated_two_no_background.png">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Marvins Portfolio</title>
</head>
<body>
<iframe id="pdfFrame" style="width:100vw; height:100vh; border:none;"></iframe>
<script>
// Read the filename from the URL
const params = new URLSearchParams(window.location.search);
const fileName = params.get('file'); // e.g., "my-document.pdf"
if (fileName) {
// Set iframe src dynamically
document.getElementById('pdfFrame').src = `pdfs/${fileName}`;
} else {
document.getElementById('pdfFrame').innerHTML = "Invalid or missing PDF file!";
}
</script>
</body>
</html>