Title: | Programmatic Conversion of PDF Tables |
---|---|
Description: | Allows the user to convert PDF tables to formats more amenable to analysis ('.csv', '.xml', or '.xlsx') by wrapping the PDFTables API. In order to use the package, the user needs to sign up for an API account on the PDFTables website (<https://pdftables.com/pdf-to-excel-api>). The package works by taking a PDF file as input, uploading it to PDFTables, and returning a file with the extracted data. |
Authors: | Eric Persson [aut, cre] |
Maintainer: | Eric Persson <[email protected]> |
License: | CC0 |
Version: | 0.1 |
Built: | 2024-11-03 03:04:08 UTC |
Source: | https://github.com/expersso/pdftables |
Convert PDF Tables to format more amenable to analysis
convert_pdf(input_file, output_file = NULL, format = "csv", message = TRUE, api_key = Sys.getenv("pdftable_api"))
convert_pdf(input_file, output_file = NULL, format = "csv", message = TRUE, api_key = Sys.getenv("pdftable_api"))
input_file |
The PDF file to be converted. If this is a url
to a PDF rather than a file path then it is downloaded to a
temporary file via |
output_file |
The desired name for the output file |
format |
One of 'csv', 'xml', 'xlsx-single', 'xlsx-multiple' |
message |
If TRUE, outputs a message that conversion was successful |
api_key |
Your API key (from https://pdftables.com) |
Creates an output file with the converted PDF table
## Not run: write.csv(head(iris), file = "test.csv", row.names = FALSE) # Open test.csv and print as PDF to "test.pdf" convert_pdf("test.pdf", "test2.csv") ## End(Not run)
## Not run: write.csv(head(iris), file = "test.csv", row.names = FALSE) # Open test.csv and print as PDF to "test.pdf" convert_pdf("test.pdf", "test2.csv") ## End(Not run)
Retrieve the number of pages left on your account
get_remaining(api_key = Sys.getenv("pdftable_api"))
get_remaining(api_key = Sys.getenv("pdftable_api"))
api_key |
Your API key (from https://pdftables.com) |
A numeric vector of length 1
## Not run: get_remaining()
## Not run: get_remaining()