Marthee commited on
Commit
bbb970b
·
verified ·
1 Parent(s): 903ca01

Update templates/gui.html

Browse files
Files changed (1) hide show
  1. templates/gui.html +13 -2
templates/gui.html CHANGED
@@ -9,9 +9,20 @@
9
 
10
  <h2>PDF Viewer</h2>
11
 
 
 
 
 
12
  <script>
13
- // Redirect to the PDF URL in the current tab
14
- window.location.href = '/download-pdf';
 
 
 
 
 
 
 
15
  </script>
16
 
17
  </body>
 
9
 
10
  <h2>PDF Viewer</h2>
11
 
12
+ <label for="page">Enter Page Number:</label>
13
+ <input id="page" type="number" min="1">
14
+ <button onclick="openPdf()">View PDF</button>
15
+
16
  <script>
17
+ function openPdf() {
18
+ const pageNumber = document.getElementById('page').value;
19
+ if (pageNumber && parseInt(pageNumber) > 0) {
20
+ // Redirect to the Flask route with page query parameter
21
+ window.location.href = `/view-pdf?page=${pageNumber}`;
22
+ } else {
23
+ alert('Please enter a valid page number');
24
+ }
25
+ }
26
  </script>
27
 
28
  </body>