pymupdf

How to change the highlight color in pdf using fitz module in python

How to change the highlight color in pdf using fitz module in python Question: Hi I am trying to change the highlight color in a pdf but not able to do so. The default highlight color is yellow but i want to change it Following is my code: import fitz doc = fitz.open(r”pathinput.pdf”) page=doc[0] text=”some …

Total answers: 3

PyMuPDF | inserted image is in the wrong place of a pdf page

PyMuPDF | inserted image is in the wrong place of a pdf page Question: I need to insert an image into some pages of a pdf and I use insertImage. Following the example I provide fitz.Rect(0, 0, 50, 50) as I want to place the image in the top left corner of the page. Works …

Total answers: 2

How do I resolve "No module named 'frontend'" error message?

How do I resolve "No module named 'frontend'" error message? Question: I have installed PymuPDF/fitz because am trying to extract images from PDF files. However, upon running the code below, I am seeing No module named ‘frontend’. doc = fitz.open(pdf_path) for i in range(len(doc)): for img in doc.getPageImageList(i): xref = img[0] pix = fitz.Pixmap(doc, xref) …

Total answers: 10