# Can not remove a box in the footer

**URL:** <https://forum.mupdf.com/t/can-not-remove-a-box-in-the-footer/180>\
**Category:** PyMuPDF\
**Created:** [October 12, 2025, 7:39am UTC](https://forum.mupdf.com/t/can-not-remove-a-box-in-the-footer/180 "2025-10-12T07:39:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolfun](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@coolfun](https://forum.mupdf.com/u/coolfun)\
**Post date:** [October 12, 2025, 7:39am UTC](https://forum.mupdf.com/t/can-not-remove-a-box-in-the-footer/180/1 "2025-10-12T07:39:55Z")

</div>

I want to remove a text box in every page footer. I tried `add_redact_annot` and `apply_redactions`and some ways, all items could be removed except that text box i really wanted.

PS: I can get and show this text box by blocks = page.get\_text(“blocks”)

[output.pdf](https://forum.mupdf.com/uploads/short-url/2bclGHG6SWCfHxSw4MXl8eyueIL.pdf) (9.3 KB)

---

<div class="post-metadata">

**Author:** ![Jamie\_Lemon](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.mupdf.com/jamie_lemon/32/5_2.png) [@Jamie\_Lemon](https://forum.mupdf.com/u/Jamie_Lemon)\
**Post date:** [October 13, 2025, 3:09pm UTC](https://forum.mupdf.com/t/can-not-remove-a-box-in-the-footer/180/2 "2025-10-13T15:09:31Z")

</div>

Hi @coolfun and welcome to the forum!

When you use `add_redact_annot`do you define the `rect` that you get from `page.get_text(“blocks”)` for the footer text box as the area you want to redact?

---

<div class="post-metadata">

**Author:** ![coolfun](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@coolfun](https://forum.mupdf.com/u/coolfun)\
**Post date:** [October 14, 2025, 6:33am UTC](https://forum.mupdf.com/t/can-not-remove-a-box-in-the-footer/180/3 "2025-10-14T06:33:18Z")

</div>

Thanks for your help!

I tried several ways, the one is below:

```auto
for page in doc:
    for annot in page.annots():

        if annot.type[1] == 'Watermark':
            print(f'Annotation on page: {page.number} with type: {annot.type} and rect: {annot.rect}')
            page.add_redact_annot(annot)
    page.apply_redactions()
doc.ez_save(output_path, garbage=4)

that outputs:
Annotation on page: 0 with type: (25, 'Watermark') and rect: Rect(127.5009994506836, 775.54345703125, 480.9460144042969, 792.0874633789062)
Annotation on page: 1 with type: (25, 'Watermark') and rect: Rect(128.84500122070312, 776.7039794921875, 482.2909851074219, 793.2479858398438)
Annotation on page: 2 with type: (25, 'Watermark') and rect: Rect(128.60499572753906, 779.10400390625, 482.0509948730469, 795.6480102539062)
Annotation on page: 3 with type: (25, 'Watermark') and rect: Rect(128.36500549316406, 775.0239868164062, 481.8110046386719, 791.5679931640625)
Annotation on page: 4 with type: (25, 'Watermark') and rect: Rect(128.48500061035156, 775.7439575195312, 481.9309997558594, 792.2879638671875)
Annotation on page: 5 with type: (25, 'Watermark') and rect: Rect(128.36500549316406, 778.3839721679688, 481.8110046386719, 794.927978515625)
Annotation on page: 6 with type: (25, 'Watermark') and rect: Rect(128.48500061035156, 778.1439819335938, 481.9309997558594, 794.68798828125)

Process finished with exit code 0

```

I even tried that:

```auto
    rect = page.rect
    annot = page.add_redact_annot(rect) 
    page.apply_redactions()

```

but these footers are still there.

---

<div class="post-metadata">

**Author:** ![Jamie\_Lemon](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.mupdf.com/jamie_lemon/32/5_2.png) [@Jamie\_Lemon](https://forum.mupdf.com/u/Jamie_Lemon)\
**Post date:** [October 14, 2025, 5:05pm UTC](https://forum.mupdf.com/t/can-not-remove-a-box-in-the-footer/180/4 "2025-10-14T17:05:39Z")

</div>

Aha - I didn’t realise they were watermark annotations. In this case you just need to remove the annotation by deleting them (you can’t redact annotations). So just do:

```python
for annot in annots:
        if annot.type[1] == 'Watermark':
            print(f'Annotation on page: {page.number} with type: {annot.type} and rect: {annot.rect}')
            page.delete_annot(annot);

```

---

<div class="post-metadata">

**Author:** ![coolfun](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@coolfun](https://forum.mupdf.com/u/coolfun)\
**Post date:** [October 15, 2025, 9:36am UTC](https://forum.mupdf.com/t/can-not-remove-a-box-in-the-footer/180/5 "2025-10-15T09:36:24Z")

</div>

Thanks @Jamie_Lemon it works perfectly. I have read many documents on the site [Document - PyMuPDF documentation](https://pymupdf.readthedocs.io/en/latest/document.html#), but I still feel difficult to understand how do these objects work about document, page, annot etc.

---

<div class="post-metadata">

**Author:** ![Jamie\_Lemon](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.mupdf.com/jamie_lemon/32/5_2.png) [@Jamie\_Lemon](https://forum.mupdf.com/u/Jamie_Lemon)\
**Post date:** [October 15, 2025, 4:39pm UTC](https://forum.mupdf.com/t/can-not-remove-a-box-in-the-footer/180/6 "2025-10-15T16:39:37Z")

</div>

Fair enough & thanks for the feedback - perhaps an introduction to what these objects are in a PDF might be useful. I guess the docs are written with the assumption that people understand what all the objects are in PDF. However, not being able to redact an annotation though - that should probably be mentioned as it isn’t immediately obvious!

---

<div class="post-metadata">

**Author:** ![coolfun](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@coolfun](https://forum.mupdf.com/u/coolfun)\
**Post date:** [October 16, 2025, 10:06am UTC](https://forum.mupdf.com/t/can-not-remove-a-box-in-the-footer/180/7 "2025-10-16T10:06:35Z")

</div>

This assumption is normal, as a professional in the related fields it is a must to. However, a well-organized book is useful to a professional or to me happen to use it for some time.
