pyfpdf icon indicating copy to clipboard operation
pyfpdf copied to clipboard

Introducing a rect_clip() function

Open Lucas-C opened this issue 5 years ago • 4 comments

This is really useful to display only part of image.

Usage example:

    with pdf.rect_clip(x=..., y=..., w=..., h=...):
        pdf.image(filepath, x, y)

I can add tests if needed

Lucas-C avatar Jul 21 '20 07:07 Lucas-C

it would probably be good to add docs as well, but im not the person who can accept pull requests on this fork of the project

alexanderankin avatar Jul 21 '20 13:07 alexanderankin

Documentation added, thanks for the suggestion @alexanderankin!

Lucas-C avatar Jul 22 '20 08:07 Lucas-C

Tested added:

$ python tests/cover/test_rect_clip.py --auto --check
OK

Lucas-C avatar Jul 22 '20 08:07 Lucas-C

This was ported to fpdf2: https://github.com/alexanderankin/pyfpdf/blob/master/CHANGELOG.md#210---2020-12-07

Lucas-C avatar Jan 06 '21 10:01 Lucas-C