I have attempted to use PyMuPDF to covert a PDF document to an image, so that I can use it in openCV. However I have an attribute error come up when I try to save the image and I'm not sure how to get around this?
import fitz
pdf = fitz.open('cornwall.pdf')
page = pdf.load_page(0)
pix = page.get_pixmap()
pix.writeImage("cornwall_output.png")
AttributeError: 'Pixmap' object has no attribute 'writeImage'