0

I am trying to understand how the build_options function defined in tabula.io module and the java_options in function convert_into work. To understand it I wrote my code with just the page options specified:

import tabula
options = tabula.io.build_options(pages="all")
dfs = tabula.io.convert_into('input.pdf',"output.csv",output_format="csv",java_options=options)

but I get this error:
Error from tabula-java: Unrecognized option: --pages
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

What's the correct way to use the build_options function?

Progman
  • 16,827
  • 6
  • 33
  • 48
Ferex
  • 553
  • 6
  • 22

1 Answers1

0

java_options expects list of string.

tabula.convert_into('input.pdf',"output.csv",output_format="csv", pages="all")

You don't have to use build_options.

See also: https://tabula-py.readthedocs.io/en/latest/tabula.html#tabula.io.convert_into

chezou
  • 486
  • 4
  • 12