* Fix for when 'trailer' is indented
Closes#214
* Address CR comments - strip line after parsing
* Update CHANGELOG.md
Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>
* Remove unused sortedcontainers package
* Fix changelog format
* Fix a link to the PR
* Update CHANGELOG.md
Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>
* Fix paint_path bug noted in issue #473
Focuses on the handling of non-rect quadrilaterals, the decomposition of
complex (m.*h)* paths into subpaths, and assigning those subpaths the
correct LTCurve/LTRect type.
Also adds a test for cases presented in issue #473
* Tweak paint_path fix per @pietermarsman review
- Adjusts logic to adhere to if-elif-else rather than early returns.
- Shortens subpath detection/reprocessing step, using re.finditer().
* Reorder paint_path() if-else statements once more
* Fix flake8 issues
* Fix error: should select item 1 and 2 from the list, and possible items [3, 4], and so on.
Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>
* Fix not being able to pass boxes flow as None to pdf2txt
* Changes from code review
* Update CHANGELOG.md
Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>
* open_filename accepts a pathlib.PurePath object
* Add test for open_filename with pathlib
* Fix a wrong function name
* Cast a pathlib object to string for py3.4/3.5
* Add link to the PR
* Raise an exception when open_filename gets an unsupported type
* Add tests for open_filename
* Update CHANGELOG.md
* Documentation
Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>
* Updated high_level.py
This commit enables caching to be turned on and off rather than be always on regardless of the user input.
* Reverted params back to fix errors
* Updated CHANGELOG.md to reflect quick fix
* Update CHANGELOG.md
Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>
* Restore PDFTextExtractionNotAllowed
Restore PDFTextExtractionNotAllowed exception class as an alias of the
new PDFTextExtractionNotAllowedError exception that was introduced in
6a9269b432
Removing PDFTextExtractionNotAllowed is an API breakage that made
several tools fail break.
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
* Use PDFTextExtractionNotAllowed and prepare PDFTextExtractionNotAllowedError to be removed in the future
* Add line to CHANGELOG.md
Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>
* Add trying to get cmap from pickle file. And cleaning up a bit.
* Don't use keyword argument for dict.get
* Add docs
* Make _get_cmap_name static
* Add test
* Add CHANGELOG.md
* Remove identity mappings from IDENTITY_ENCODER because that's now the default if the key is not in there
* Add CJK characters to expected output of simple3.pdf
* Fix line length
* Add comment
* swap pycryptodome to the faster, smaller, and industry standard crytography io
* update changelog
* fixlint
* Update CHANGELOG.md
* from MR, unneeded ex and naming
* add samples to nosetests
* fix lint
* show mismatch
* fix lint
* typo and newline
* Revert "add samples to nosetests"
This reverts commit a49ca302
* Add tests for encrypted documents to nose test suite
* Optimize imports of pdfdocument.py
Co-authored-by: Oren Tysor <oren@atakama.com>
Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>
* Fix converting path to multiple rectangles
For path that consists of a series of rectangles
(shape is 'mlllhmlllh...'), call paint_path again with each group of
5 points. The result is multiple rects instead of a single curve.
fixes#369
* Reduce pdf size by removing font
* Add unittest for PDFLayoutAnalyzer.paint_path()
* Add line to CHANGELOG.md
* Add reference to pdf reference manual
* Cleanup function paint_path a bit
* Reduce line length of tests
* Reduce line length of tests
Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>
* Changed error to warning for 'Text extraction is not allowed'
* updated changelog
* fix lint
* made changes suggested in review
* Update CHANGELOG.md
* Add regression test for failing pdf
* Reduce line length to <80
Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>
Fixes#176
* Add failing test for dumping simple1.pdf and simple3.pdf, because they should raise an error when dumppdf.py tries to dump a pdf without xref's
* Raise PDFNoValidXRef with explanation if dumppdf.py is called on a pdf that does not have an xref
* Use warning instead of error, because not output xrefs is just fine (there aren't any) but it is something the user should know
* Adding changelog
* Extend help message
* Make structure of documentation more clear: tutorials, how-to, topics and reference
* Add howto for images
* Restructure tutorials section, and add install section
* Always use up-to-date version
* Fix indentation warning in docstring
* Add option to dumppdf.py and pdf2txt.py to show version
Fixes#162
* add shebang line to script in tools
* fix: use shebang line with python 3
* Moved changelog to unreleased
Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>
* Update documentation for boxes_flow, allow None
* Apply comments from code review
* Small wording changes, remove unnecessary comment
* Update boxes_flow documentation for pdf2text
* Pin version of tox to ensure python 3.4 support
* Updated misleading documentation about word_margin
* Small change in sentence about word_margin
* Remove confusing sentence about adding spaces
Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>
* Group text lines if they are centered (#382)
Closes#382
* Add comparison private methods to LTTextLines
* Add missing docstrings
* Add tests for find_neighbors
* Update changelog
* Cosmetic changes from code review
* Catch ValueError when calling `name2unicode` when a unicode value cannot be parsed
* Add test for catching ValueError and KeyError when font encoding differences are invalid
* Added line to CHANGELOG.md
* Default value for --all-texts should be false, because using the flag enables it
* Fix edge case: when no neighbors are found a line should form its own text box
* Added test for grouping textlines where 1 is outside the parent bounding box
* Added CHANGELOG.md line