diff --git a/docs/user/extract-images.md b/docs/user/extract-images.md index 1873778ae..fa3f6158d 100644 --- a/docs/user/extract-images.md +++ b/docs/user/extract-images.md @@ -12,12 +12,10 @@ from pypdf import PdfReader reader = PdfReader("example.pdf") page = reader.pages[0] -count = 0 -for image_file_object in page.images: +for count, image_file_object in enumerate(page.images): with open(str(count) + image_file_object.name, "wb") as fp: fp.write(image_file_object.data) - count += 1 ``` # Other images