pymupdf / PyMuPDF

PyMuPDF is a high performance Python library for data extraction, analysis, conversion & manipulation of PDF (and other) documents.
https://pymupdf.readthedocs.io
GNU Affero General Public License v3.0
5.33k stars 510 forks source link

How to hide annoation popup / "sticky note"- icon? #3243

Closed stefaneidelloth closed 7 months ago

stefaneidelloth commented 7 months ago

I created an annoation with a hover text:

vertices = [(100, 400), (200, 400), (150, 500)]

# Create a polygon annotation on the page
annotation = page.add_polygon_annot(vertices)

# Set the annotation's properties (optional)
annotation.set_border(width=1.5)
annotation.set_opacity(0.5)

popup_rect = fitz.Rect(300, 400, 500, 500)  
annotation.set_popup(popup_rect)
annotation.set_info(None, 'content', 'title')

image

=> How can I hide the yellow annotation icon?
image

stefaneidelloth commented 7 months ago

Disabling Edit => Preferences => Enable text indicators and tooltips in Acrobat Reader removed the sticky note icons for me. 

However, I would like to store this this info with the document

Related: https://community.adobe.com/t5/acrobat-discussions/remove-unnecessary-comment-icon-on-highlight-comment/td-p/3530334

JorjMcKie commented 7 months ago

Already implemented!

If an annotation has a popup, you can request setting it "open" or "closed" - see documentation here. Independent from that, use the annotation flags to set desired bits. in your case, you could use "hidden" image

JorjMcKie commented 7 months ago

Moving this to "Discussions" for potential further questions.