Previously, utils.extract_text(...) returned incorrect results in
certain cases when vertical text was present, as observed in
https://github.com/jsvine/pdfplumber/pull/192. This commit fixes that
by first segregating vertical and horizontal text (via "upright" char
attribute) before clustering characters.
It also adds two parameters, horizontal_ltr and vertical_ttb, to give
users control over whethere words are meant to be read left-to-right
and/or top-to-bottom vs. their opposites.
Form values in PDF files are handled differently than other text, so
it's not supported through the existing pdfminer APIs, but it can be
access through pdfminer's wrapping of pdfplumber.
Add a section to the README to save others the confusion I faced when
figuring out how to access form data.
Addresses #120https://github.com/jsvine/pdfplumber/issues/120
@ Added
- Access to `curve` points. (E.g., `page.curves[0]["points"]`.)
- Ability for `.draw_line` to draw `curve` points.
@ Changed
- Disaggregated "min_words_vertical" (default: 3) and "min_words_horizontal" (default: 1), removing "text_word_threshold".
- Internally, made `utils.decimalize` a bit more robust; now throws errors on non-decimalizable items.
- Now explicitly ignoring some (obscure) `pdfminer` object attributes.
- Raw input for `.draw_line` from a bounding box to `((x, y), (x, y))`, for consistency with `curve["points"]` and with `Pillow`'s underlying method.
@ Fixed
- Fixed typo bug when `.rect_edges` is called before `.edges`
- Quick-draw `PageImage` methods: `.draw_vline`, `.draw_vlines`, `.draw_hline`, and `.draw_hlines`.
- Boolean parameter `keep_blank_chars` for `.extract_words(...)` and `TableFinder` settings.
- Increased default `text_tolerance` and `intersection_tolerance` TableFinder values from 1 to 3.
- Properly handle conversion of PDFs with transparency to `pillow` images.
- Properly handle `pandas` DataFrames as inputs to multi-draw commands (e.g., `PageImage.draw_rects(...)`).