> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/core/smart-data-extraction/table.md).

# Tabular Data Extraction

Apryse's Tabular Data Extraction engine transforms PDFs with tables into clean, structured outputs you can use in spreadsheets, analytics tools, or downstream systems.

{% hint style="info" %}
**Requirements**

*These packages are required to use these features in production. Trial keys have unlimited access to all features*

<a href="https://apryse.com/capabilities#SmartDataExtraction" class="button primary">Package: Smart Data Extraction</a><a href="/core/learn-more/modules.md#data-extraction-module" class="button primary">Module: Data Extraction</a><a href="https://showcase.apryse.com/document-structure-extraction" class="button primary">Live demo</a>
{% endhint %}

Apryse's Tabular Data Extraction engine transforms PDFs with tables into clean, structured outputs you can use in spreadsheets, analytics tools, or downstream systems. Whether you're processing invoices, reports, or research data, this engine helps you turn visual tables into machine-readable formats.

### How It Works

The engine detects the row and column structure across pages and consolidates all text into a structured table. It's designed to handle both native and scanned PDFs with a strong focus on numerical and tabular data.

You can export the data as:

* **JSON** (ideal for programmatic use)
* **Excel (XLSX)** (ideal for business workflows)

### JSON Output Specification

Refer to the following specifications to learn more about the output JSON format:

* [JSON Specification for Tabular Data and Document Structure](https://sdk.apryse.com/api/structurejson/index.html)

### Extract tabular data as JSON file

Specify the name of the input PDF file and the name of the output JSON file, then select the Tabular engine:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
DataExtractionModule.ExtractData("table.pdf", "table.json", DataExtractionModule.DataExtractionEngine.e_tabular);
```

{% endcode %}
{% endtab %}

{% tab title="C++" %}
{% code lineNumbers="true" %}

```cpp
DataExtractionModule::ExtractData("table.pdf", "table.json", DataExtractionModule::e_Tabular);
```

{% endcode %}
{% endtab %}

{% tab title="Go" %}
{% code lineNumbers="true" %}

```go
DataExtractionModuleExtractData("table.pdf", "table.json", DataExtractionModuleE_Tabular)
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
DataExtractionModule.extractData("table.pdf", "table.json", DataExtractionModule.DataExtractionEngine.e_tabular);
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
await PDFNet.DataExtractionModule.extractData('table.pdf', 'table.json', PDFNet.DataExtractionModule.DataExtractionEngine.e_Tabular);
```

{% endcode %}
{% endtab %}

{% tab title="PHP" %}
{% code lineNumbers="true" %}

```php
DataExtractionModule::ExtractData("table.pdf", "table.json", DataExtractionModule::e_Tabular);
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code lineNumbers="true" %}

```python
DataExtractionModule.ExtractData("table.pdf", "table.json", DataExtractionModule.e_Tabular)
```

{% endcode %}
{% endtab %}

{% tab title="Ruby" %}
{% code lineNumbers="true" %}

```ruby
DataExtractionModule.ExtractData("table.pdf", "table.json", DataExtractionModule::E_Tabular)
```

{% endcode %}
{% endtab %}

{% tab title="VB" %}
{% code lineNumbers="true" %}

```vb
DataExtractionModule.ExtractData("table.pdf", "table.json", DataExtractionModule.DataExtractionEngine.e_tabular)
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Extract tabular data as JSON string

If you are going to parse the JSON right away, you may as well retrieve it as an in-memory string, instead of an external file.

Specify the name of the input PDF file, then select the Tabular engine:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
string json = DataExtractionModule.ExtractData("financial.pdf", DataExtractionModule.DataExtractionEngine.e_tabular);
```

{% endcode %}
{% endtab %}

{% tab title="C++" %}
{% code lineNumbers="true" %}

```cpp
UString json = DataExtractionModule::ExtractData("financial.pdf", DataExtractionModule::e_Tabular);
```

{% endcode %}
{% endtab %}

{% tab title="Go" %}
{% code lineNumbers="true" %}

```go
json := DataExtractionModuleExtractData("financial.pdf", DataExtractionModuleE_Tabular).(string)
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
String json = DataExtractionModule.extractData("financial.pdf", DataExtractionModule.DataExtractionEngine.e_tabular);
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
const json = await PDFNet.DataExtractionModule.extractDataAsString('financial.pdf', PDFNet.DataExtractionModule.DataExtractionEngine.e_Tabular);
```

{% endcode %}
{% endtab %}

{% tab title="PHP" %}
{% code lineNumbers="true" %}

```php
$json = DataExtractionModule::ExtractData("financial.pdf", DataExtractionModule::e_Tabular);
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code lineNumbers="true" %}

```python
json = DataExtractionModule.ExtractData("financial.pdf", DataExtractionModule.e_Tabular)
```

{% endcode %}
{% endtab %}

{% tab title="Ruby" %}
{% code lineNumbers="true" %}

```ruby
json = DataExtractionModule.ExtractData("financial.pdf", DataExtractionModule::E_Tabular)
```

{% endcode %}
{% endtab %}

{% tab title="VB" %}
{% code lineNumbers="true" %}

```vb
Dim json As String = DataExtractionModule.ExtractData("financial.pdf", DataExtractionModule.DataExtractionEngine.e_tabular)
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Extract tabular data as Excel file

Specify the name of the input PDF file and the name of the output XLSX file:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
DataExtractionModule.ExtractToXLSX("table.pdf", "table.xlsx");
```

{% endcode %}
{% endtab %}

{% tab title="C++" %}
{% code lineNumbers="true" %}

```cpp
DataExtractionModule::ExtractToXLSX("table.pdf", "table.xlsx");
```

{% endcode %}
{% endtab %}

{% tab title="Go" %}
{% code lineNumbers="true" %}

```go
DataExtractionModuleExtractToXLSX("table.pdf", "table.xlsx")
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
DataExtractionModule.extractToXLSX("table.pdf", "table.xlsx");
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
await PDFNet.DataExtractionModule.extractToXLSX('table.pdf', 'table.xlsx');
```

{% endcode %}
{% endtab %}

{% tab title="PHP" %}
{% code lineNumbers="true" %}

```php
DataExtractionModule::ExtractToXLSX("table.pdf", "table.xlsx");
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code lineNumbers="true" %}

```python
DataExtractionModule.ExtractToXLSX("table.pdf", "table.xlsx")
```

{% endcode %}
{% endtab %}

{% tab title="Ruby" %}
{% code lineNumbers="true" %}

```ruby
DataExtractionModule.ExtractToXLSX("table.pdf", "table.xlsx")
```

{% endcode %}
{% endtab %}

{% tab title="VB" %}
{% code lineNumbers="true" %}

```vb
DataExtractionModule.ExtractToXLSX("table.pdf", "table.xlsx")
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Extract tabular data as Excel stream

Specify the name of the input PDF file and an output filter, such as MemoryFilter:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
MemoryFilter output_xlsx_stream = new MemoryFilter(0, false);
DataExtractionModule.ExtractToXLSX("financial.pdf", output_xlsx_stream);
```

{% endcode %}
{% endtab %}

{% tab title="C++" %}
{% code lineNumbers="true" %}

```cpp
MemoryFilter output_xlsx_stream(0, false);
DataExtractionModule::ExtractToXLSX("financial.pdf", output_xlsx_stream);
```

{% endcode %}
{% endtab %}

{% tab title="Go" %}
{% code lineNumbers="true" %}

```go
outputXlsxStream := NewMemoryFilter(0, false)
DataExtractionModuleExtractToXLSX("financial.pdf", outputXlsxStream)
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
MemoryFilter output_xlsx_stream = new MemoryFilter(0, false);
DataExtractionModule.extractToXLSX("financial.pdf", output_xlsx_stream);
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
const outputXlsxStream = PDFNet.Filters.MemoryFilter(0, false);
await PDFNet.DataExtractionModule.extractToXLSX('financial.pdf', outputXlsxStream);
```

{% endcode %}
{% endtab %}

{% tab title="PHP" %}
{% code lineNumbers="true" %}

```php
$outputXlsxStream = new MemoryFilter(0, false);
DataExtractionModule::ExtractToXLSX("financial.pdf", $outputXlsxStream);
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code lineNumbers="true" %}

```python
outputXlsxStream = Filters.MemoryFilter(0, False)
DataExtractionModule.ExtractToXLSX("financial.pdf", outputXlsxStream)
```

{% endcode %}
{% endtab %}

{% tab title="Ruby" %}
{% code lineNumbers="true" %}

```ruby
outputXlsxStream = Filters.MemoryFilter.new(0, false)
DataExtractionModule.ExtractToXLSX("financial.pdf", outputXlsxStream)
```

{% endcode %}
{% endtab %}

{% tab title="VB" %}
{% code lineNumbers="true" %}

```vb
Dim output_xlsx_stream As MemoryFilter = New MemoryFilter(0, False)
DataExtractionModule.ExtractToXLSX("financial.pdf", output_xlsx_stream)
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Optional Configuration

[Select OCR Language](/core/smart-data-extraction/workflow.md#select-ocr-language)

[Password-Protected PDFs](/core/smart-data-extraction/workflow.md#specify-pdf-password)

[Page Range](/core/smart-data-extraction/workflow.md#select-a-page-range)

### Best Use Cases

* Financial statements
* Invoices and billing reports
* Research tables
* Survey exports
* Any document where tabular data is the core structure


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/core/smart-data-extraction/table.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
