1

I am trying to use pdftables package to extract data into csv.

install.packages("pdftables") library(pdftables) 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") 

However, I am getting the following error:

Error in get_content(input_file, format, api_key) : Bad Request (HTTP 400).

What's the fix here?

1
  • You want to convert a csv file to pdf? Commented Jul 12, 2018 at 19:01

2 Answers 2

3

Did you get an API token?

To use the package the user first needs to sign up to the PDFTables API to get an API token (they offer a free package that allows up to 50 pages).

See: https://cran.r-project.org/web/packages/pdftables/README.html

Sign up to request clarification or add additional context in comments.

1 Comment

So, for more than 50 pages, we need to pay?
1

To use the PDFTables R package, you need to the run the following command:

convert_pdf('test/index.pdf', output_file = NULL, format = "xlsx-single", message = TRUE, api_key = "insert_API_key") 

Make sure you replace insert_API_key with your API key, and change the file path and/or format.

More info here: https://pdftables.com/blog/convert-pdf-to-excel-r

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.