Skip to content

Commit

Permalink
v0.5.3; quickfix re. ImageMagick/wand import
Browse files Browse the repository at this point in the history
Allow `pdfplumber` import even if ImageMagick not installed.
  • Loading branch information
jsvine committed Feb 28, 2017
1 parent 9d0c378 commit 72a13c9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. Currently g

The format is based on [Keep a Changelog](http://keepachangelog.com/).

## [0.5.3] — 2017-02-27
### Fixed
- Allow `pdfplumber` import even if ImageMagick not installed.

## [0.5.2] — 2017-02-27
### Added
- Access to `curve` points. (E.g., `page.curves[0]["points"]`.)
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PDFPlumber `v0.5.2`
# PDFPlumber `v0.5.3`

Plumb a PDF for detailed information about each text character, rectangle, and line. Plus: Table extraction and visual debugging.

Expand All @@ -22,6 +22,8 @@ Currently [tested](tests/) on [Python 2.7, 3.1, 3.4, 3.5, and 3.6](tox.ini).
pip install pdfplumber
```

To use `pdfplumber`'s visual-debugging tools, you'll also need to have [`ImageMagick`](https://www.imagemagick.org/) installed on your computer. [Installation instructions here](http://docs.wand-py.org/en/latest/guide/install.html#install-imagemagick-debian).

## Command line interface

### Basic example
Expand Down
2 changes: 1 addition & 1 deletion pdfplumber/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version_info = (0, 5, 2)
version_info = (0, 5, 3)
__version__ = '.'.join(map(str, version_info))
7 changes: 4 additions & 3 deletions pdfplumber/page.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from . import utils
from .table import TableFinder
from .container import Container
from .display import PageImage, DEFAULT_RESOLUTION
from copy import copy

from six import string_types
Expand Down Expand Up @@ -204,11 +203,13 @@ def objects(self):
filtered.bbox = self.bbox
return filtered

def to_image(self, resolution=DEFAULT_RESOLUTION):
def to_image(self, resolution=None):
"""
For conversion_kwargs, see http://docs.wand-py.org/en/latest/wand/image.html#wand.image.Image
"""
return PageImage(self, resolution=resolution)
from .display import PageImage, DEFAULT_RESOLUTION
res = resolution or DEFAULT_RESOLUTION
return PageImage(self, resolution=res)

class DerivedPage(Page):
is_original = False
Expand Down

0 comments on commit 72a13c9

Please sign in to comment.