Does anyone have tried before to replace text from a PDF File using Fitz of PyMuPDF Library ?
i have tried to use the code below and i am not sure if i am close to the result or it's impossible to use using this library:
import fitz
file_name = 'D:/DOSSIERS/pdf_file.pdf'
with fitz.Document(file_name) as doc:
for page in doc:
for xref in page.get_contents():
stream = doc.xref_stream(xref).replace(b'mis',b'kjhkj')
doc.update_stream(xref, stream)