Standardize handling of cropbox

... fixing various issues with PageImage. Also adds
force_mediabox parameter to Page.to_image(...).

Thanks to @stefanw for flagging:
    https://github.com/jsvine/pdfplumber/issues/1054
This commit is contained in:
Jeremy Singer-Vine
2024-01-05 10:14:44 -05:00
parent f4f4473a17
commit 07d9997ee5
7 changed files with 96 additions and 49 deletions
+1
View File
@@ -273,6 +273,7 @@ To turn any page (including cropped pages) into an `PageImage` object, call `my_
- `width`: The desired image width in pixels. Default: unset, determined by `resolution`. Type: `int`.
- `height`: The desired image width in pixels. Default: unset, determined by `resolution`. Type: `int`.
- `antialias`: Whether to use antialiasing when creating the image. Setting to `True` creates images with less-jagged text and graphics, but with larger file sizes. Default: `False`. Type: `bool`.
- `force_mediabox`: Use the page's `.mediabox` dimensions, rather than the `.cropbox` dimensions. Default: `False`. Type: `bool`.
For instance: