/TabulaKit

Swift framework to extract tables from PDFs, wrapping Java tabula.

Primary LanguageSwift

TabulaKit

Swift framework to extract tables from PDFs, wrapping Java tabula.

Requirements

TabulaKit requires Swift 5 and Java. It has been tested on macOS, Linux and Windows.

Usage

You can extract tables from a PDF document using a TabulaPDF instance:

import Foundation
import TabulaKit

let inputURL = URL(fileURLWithPath: "Invoice.pdf")
let inputPDF = try TabulaPDF(contentsOf: inputURL)
let extractedTables = try inputPDF.extractTables()
print(extractedTables.count)
// 1
print(extractedTables[0])
// [
//   ["Service", "Cost"],
//   ["mobilR", "13.95€"],
//   ["comboR", "46.90€"],
//   ["Other", "17.70€"]
// ]

Swift Package Manager

Add the following dependency to your Package.swift manifest:

.package(url: "https://github.com/pvieito/TabulaKit.git", .branch("master")),

Notes

TabulaKit is heavily inspired by tabula-py, a Python wrapper of tabula-java.