diff --git a/camelot/cli.py b/camelot/cli.py index e45664c1..18a22c7c 100644 --- a/camelot/cli.py +++ b/camelot/cli.py @@ -284,6 +284,13 @@ def stream(c, *args, **kwargs): columns = list(kwargs["columns"]) kwargs["columns"] = None if not columns else columns + margins = conf.pop('margins') + + if margins is None: + layout_kwargs = {} + else: + layout_kwargs = {"char_margin": margins[0], "line_margin": margins[1], "word_margin": margins[2]} + if plot_type is not None: if not _HAS_MPL: raise ImportError("matplotlib is required for plotting.") @@ -294,7 +301,7 @@ def stream(c, *args, **kwargs): raise click.UsageError("Please specify output file format using --format") tables = read_pdf( - filepath, pages=pages, flavor="stream", suppress_stdout=quiet, **kwargs + filepath, pages=pages, flavor="stream", suppress_stdout=quiet, layout_kwargs=layout_kwargs, **kwargs ) click.echo(f"Found {tables.n} tables") if plot_type is not None: