Spaces:
Sleeping
Sleeping
File size: 810 Bytes
12daac8 1c80c12 e89e663 5f5b6de 2762c12 99d4263 b650d52 196caba b650d52 196caba 99d4263 b650d52 196caba 2762c12 99d4263 2762c12 b650d52 2762c12 5f5b6de 92874af 1c80c12 9abb0bf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>View PDF</title>
</head>
<body>
<script>
function openPdf() {
// Ensure Flask passes a default value of 1 if page is not specified
const page = {{ page if page else 1 }}; // Pass `1` as a fallback value
console.log(page)
if (page && parseInt(page) > 0) {
// Open PDF on a new tab with Flask URL and the specified page number
window.location.href = `/view-pdf#page=${page}`;
} else {
alert('Please enter a valid page number');
}
}
openPdf(); // Call the function
</script>
</body>
</html>
|