Code samples
Table extraction from PDF
This section describes two methods for extracting tables from PDF files.
This sample code utilizes the Unstructured Open Source library and also provides an alternative method the utilizing the Unstructured Serverless API.
Method 1: Using partition_pdf
To extract the tables from PDF files using the partition_pdf, set the infer_table_structure
parameter to True
and strategy
parameter to hi_res
.
Usage
Method 2: Using Auto Partition or Unstructured API
By default, table extraction from all file types is enabled. To extract tables from PDFs and images using Auto Partition or Unstructured API parameters simply set strategy
parameter to hi_res
.
Usage: Auto Partition
Usage: API Parameters
Was this page helpful?