import pikepdf file_path = "path_name" pdf = pikepdf.open(file_path, allow_overwriting_input=True) pdf.save('path_name/saved.pdf')