-
Notifications
You must be signed in to change notification settings - Fork 651
Add Annotations Creating a White Space #4733
-
Hi, I see people have had this issue before, referencing #4709
When I run add_redact_annot it creates a whitespace that I am not sure how to get rid of. I tried the solution in the discussion that I referenced but I was not able to get it to work. Any suggestions?
imagefor page in pdf:
for attr in pdf_content:
translations = attr[0]
font = self.font_validator(attr[1])
size = attr[2]
color = self.color_validator(attr[3])
bbox = attr[4]
page.add_redact_annot(bbox,text=translations, fontname=font, fontsize=size, text_color=color)
page.apply_redactions(images=pymupdf.PDF_REDACT_IMAGE_NONE,graphics=pymupdf.PDF_REDACT_LINE_ART_NONE)
Beta Was this translation helpful? Give feedback.
All reactions
It does not create a white space - it leaves a gap!
There is no way to avoid this: please recall that a PDF is not a Word document, where remaining content is reshuffled after deletion.
The referenced discussion had a different, self-created the problem. If you allow defaults in .apply_redactions()
then more than just the text is being removed: If there was an overlapping image, then that will show a punched-out hole, any overlapping vector graphics will be completely removed ...
Replies: 1 comment 1 reply
-
It does not create a white space - it leaves a gap!
There is no way to avoid this: please recall that a PDF is not a Word document, where remaining content is reshuffled after deletion.
The referenced discussion had a different, self-created the problem. If you allow defaults in .apply_redactions()
then more than just the text is being removed: If there was an overlapping image, then that will show a punched-out hole, any overlapping vector graphics will be completely removed ...
Beta Was this translation helpful? Give feedback.
All reactions
-
Ok that makes sense. Thank you
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1