Replies: 5 comments 2 replies
-
If these are true images (with an xref etc.) you can delete them via Otherwise you can use redactions, which now can also erase vector graphics (v1.24.0). |
Beta Was this translation helpful? Give feedback.
-
Can you share a full code to remove for example above file? |
Beta Was this translation helpful? Give feedback.
-
thank you, how to add a condition to exclude some images, like speicified width, height etc. |
Beta Was this translation helpful? Give feedback.
-
images = page.get_images(full=True)
printed img info is like this: (30, 0, 396, 1034, 1, 'DeviceGray', '', 'Im2', 'JBIG2Decode', 0) |
Beta Was this translation helpful? Give feedback.
-
I can judge and delete now with below code. Import PyMuPDFimport fitz File path you want to extract images fromfile = "data.pdf" Open the filepdf_file = fitz.open(file) Iterate over PDF pagesfor page_index in range(len(pdf_file)):
Close the PDF documentpdf_file.close() |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions