Skip to content

Instantly share code, notes, and snippets.

@documentprocessing
Last active April 27, 2024 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save documentprocessing/b883d532025eec8cf7ebff0640fa7255 to your computer and use it in GitHub Desktop.
Save documentprocessing/b883d532025eec8cf7ebff0640fa7255 to your computer and use it in GitHub Desktop.
Extract tables from PDF file using pdf2docx API
from pdf2docx import Converter
pdf_file = 'sample_pdf.pdf'
converter = Converter(pdf_file)
tables = converter.extract_tables(start=0, end=1)
converter.close()
#loop through the tables to print these
for table in tables:
print(table)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment