app.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import fitz # Path of the PDF file input_file = r"bulkfile.pdf" # Path for the output PDF file output_file = r"modified_test.pdf" # Opening the PDF file and creating a handle for it file_handle = fitz.open(input_file) # The index (page no.) from where the pages are to be deleted start = 2 # The index to which the pages are to be deleted end = 7 # Passing the start & end index as arguments file_handle.delete_pages(start, end) # Saving the file file_handle.save(output_file) |