Marthee commited on
Commit
24a4024
·
verified ·
1 Parent(s): d421638

Update templates/gui.html

Browse files
Files changed (1) hide show
  1. templates/gui.html +20 -1
templates/gui.html CHANGED
@@ -13,10 +13,28 @@
13
 
14
  ///////////////////////////////////////////////BEGIN JS CODE//////////////////////////////////////////////////
15
  // Function to send the Dropbox link and keyword to the server
 
 
 
 
 
 
 
 
 
16
  function processPdf() {
 
 
 
 
 
 
 
 
17
  const pdfLink = 'https://www.dropbox.com/scl/fi/hnp4mqigb51a5kp89kgfa/00801-ARC-20-ZZ-S-A-0002.pdf?rlkey=45abeoebzqw4qwnslnei6dkd6&st=m4yrcjm2&dl=1'; // Dropbox link
18
- const keyword = ['115 INTEGRATED MRI ROOM LININGS'] ; // Example keyword
19
 
 
20
  // Create a new FormData object to send the data as form data
21
  const formData = new FormData();
22
  formData.append('pdf_link', pdfLink);
@@ -45,4 +63,5 @@ function processPdf() {
45
 
46
  // Call the function to process the PDF
47
  processPdf();
 
48
  </script>
 
13
 
14
  ///////////////////////////////////////////////BEGIN JS CODE//////////////////////////////////////////////////
15
  // Function to send the Dropbox link and keyword to the server
16
+ function getURLParams() {
17
+ const urlParams = new URLSearchParams(window.location.search);
18
+ return {
19
+ pdfLink: urlParams.get('pdf_link'),
20
+ keyword: urlParams.get('keyword'),
21
+ pageNumber: parseInt(urlParams.get('page')) || 1,
22
+ zoomRect: urlParams.get('zoom') // Expecting format: "x,y,width,height"
23
+ };
24
+ }
25
  function processPdf() {
26
+ // const pdfLink = 'https://www.dropbox.com/scl/fi/hnp4mqigb51a5kp89kgfa/00801-ARC-20-ZZ-S-A-0002.pdf?rlkey=45abeoebzqw4qwnslnei6dkd6&st=m4yrcjm2&dl=1'; // Dropbox link
27
+ // const keyword = ['115 INTEGRATED MRI ROOM LININGS','710 TRANSPORTATION'] ; // Example keyword
28
+
29
+ const { pdfLink, keyword, pageNumber, zoomRect } = getURLParams();
30
+ if (pdfLink){
31
+ console.log('p')
32
+ }
33
+ else{
34
  const pdfLink = 'https://www.dropbox.com/scl/fi/hnp4mqigb51a5kp89kgfa/00801-ARC-20-ZZ-S-A-0002.pdf?rlkey=45abeoebzqw4qwnslnei6dkd6&st=m4yrcjm2&dl=1'; // Dropbox link
35
+ const keyword = ['115 INTEGRATED MRI ROOM LININGS','710 TRANSPORTATION'] ; // Example keyword
36
 
37
+ }
38
  // Create a new FormData object to send the data as form data
39
  const formData = new FormData();
40
  formData.append('pdf_link', pdfLink);
 
63
 
64
  // Call the function to process the PDF
65
  processPdf();
66
+
67
  </script>