Files
MarvinKrausser.github.io/pdf_viewer.html
T
2026-04-01 00:12:00 +02:00

36 lines
1.1 KiB
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>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:wght@300;400;500&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="header_style.css">
<style>
body{
overflow: hidden;
}
</style>
</head>
<body>
<iframe id="pdfFrame" style="width:100%; 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>