I have inserted a text in an existing pdf document using page.insert_text function of pyMuPdf. However, on saving the document, the inserted text is not visible on the page at the location. There is an image that appears on the foreground and the text disappears behind it. When I search the pdf for the inserted text, a box is highlighted at the location where it is inserted but the text is not visible. This is the code:
doc = fitz.open("a.pdf")
for page in doc:
page.insert_text((page.rect.height - 50, 50), "thistextthistext",
fontsize=18,color=(0,0,0))
doc.saveIncr()
doc.close()
Also, what are the parameters stroke_capacity and render_mode for?
I tried to modify the overlay option to False. When the pdf loads, the inserted text briefly appears at the position but is immediately overwritten by the image, rendering the text invisible.
Thanks.