BhagatSurya commited on
Commit
fa29ba8
1 Parent(s): cbbc0b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -38,6 +38,8 @@ def pdf_to_text(file):
38
  image_list = page.get_images(full=True)
39
  for img in image_list:
40
  xref, name, ext, color_space, width, height, bpc, image_data, image_mask, smask_data = img
 
 
41
  image = Image.open(io.BytesIO(image_data))
42
  latex_code = image_to_latex(image)
43
  page_text += "\n" + latex_code # Add LaTeX code to page text
@@ -55,6 +57,7 @@ def pdf_to_text(file):
55
 
56
  return output_file_name, page_number
57
 
 
58
  iface = gr.Interface(fn=pdf_to_text,
59
  inputs=gr.inputs.File(label="Your PDF"),
60
  outputs=gr.outputs.File(label="Download TXT"),
 
38
  image_list = page.get_images(full=True)
39
  for img in image_list:
40
  xref, name, ext, color_space, width, height, bpc, image_data, image_mask, smask_data = img
41
+ print(type(image_data)) # Print the type of image_data
42
+ print(image_data[:100]) # Print the first 100 characters of image_data
43
  image = Image.open(io.BytesIO(image_data))
44
  latex_code = image_to_latex(image)
45
  page_text += "\n" + latex_code # Add LaTeX code to page text
 
57
 
58
  return output_file_name, page_number
59
 
60
+
61
  iface = gr.Interface(fn=pdf_to_text,
62
  inputs=gr.inputs.File(label="Your PDF"),
63
  outputs=gr.outputs.File(label="Download TXT"),