Skip to content
Discussion options

You must be logged in to vote

Use a redaction annotation:

  1. determine bbox (rectangle) covered by image on page
  2. create a redact annotation with the image's bbox
  3. apply redaction
bbox = page.get_image_rects(7)[0]  # get bbox
bbox = bbox.irect  # enlarge to include integer pixels
page.add_redact_annot(bbox)  # define redact annot
page.apply_redactions(images=fitz.PDF_REDACT_IMAGE_REMOVE)

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@JorjMcKie
Comment options

@pycgo
Comment options

@JorjMcKie
Comment options

@pycgo
Comment options

@nissansz
Comment options

Answer selected by pycgo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1298 on September 30, 2021 10:22.