Marthee commited on
Commit
ebfd3af
·
verified ·
1 Parent(s): 45e865e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -35,18 +35,18 @@ def receive_pdf_data():
35
  global pdf_content, pageNumTextFound
36
 
37
  # Get PDF link and keyword from the request body
38
- pdf_link = request.form.get('pdf_link')
39
  keyword = request.form.get('keyword')
40
 
41
- if not pdf_link or not keyword:
42
- return jsonify({"error": "Both 'pdf_link' and 'keyword' must be provided."}), 400
43
 
44
  try:
45
  # Call the function to process the PDF
46
  keyword = json.loads(keyword)
47
 
48
  global pdf_content
49
- pdf_content, pageNumTextFound,highlight_rect = Find_Hyperlinking_text.annotate_text_from_pdf([pdf_link], keyword)
50
 
51
  if pdf_content is None:
52
  return jsonify({"error": "No valid PDF content found."}), 404
 
35
  global pdf_content, pageNumTextFound
36
 
37
  # Get PDF link and keyword from the request body
38
+ pdfLink = request.form.get('pdfLink')
39
  keyword = request.form.get('keyword')
40
 
41
+ if not pdfLink or not keyword:
42
+ return jsonify({"error": "Both 'pdfLink' and 'keyword' must be provided."}), 400
43
 
44
  try:
45
  # Call the function to process the PDF
46
  keyword = json.loads(keyword)
47
 
48
  global pdf_content
49
+ pdf_content, pageNumTextFound,highlight_rect = Find_Hyperlinking_text.annotate_text_from_pdf([pdfLink], keyword)
50
 
51
  if pdf_content is None:
52
  return jsonify({"error": "No valid PDF content found."}), 404