-
Description of the bugDear JorjMcKie, I am currently working with a PDF document that contains text, and I have encountered a challenge. When I use the I have searched the documentation but have not found a method to detect when text is covered by an image or to adjust the layering order during the insertion process. Could you please advise if there is a way to achieve this, or if there is any functionality in the library that I might have overlooked? Thank you for your time and assistance. How to reproduce the bug
PyMuPDF version1.24.7 Operating systemMacOS Python version3.11 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
This is a typical Discussions item .... transferring first. |
Beta Was this translation helpful? Give feedback.
-
Simply add parameter for rect_index, rect in enumerate(image_rect, start=0):
print(rect_index, rect)
image_xref = page.insert_image(
image_rect[rect_index],
stream=compressed_base_image_bytes,
mask=compressed_mask_image_bytes,
xref=image_xref,
overlay=False, # <=== puts in background
)
# you do not need this:
# page.apply_redactions(pymupdf.PDF_REDACT_IMAGE_NONE)
`` |
Beta Was this translation helpful? Give feedback.
Simply add parameter
overlay=False
: