Marthee commited on
Commit
c6f3e06
·
verified ·
1 Parent(s): 12dd4b6

Update Doors_Schedule.py

Browse files
Files changed (1) hide show
  1. Doors_Schedule.py +2 -1
Doors_Schedule.py CHANGED
@@ -595,7 +595,8 @@ def modify_author_in_pypdf2(pdf_bytes, new_authors):
595
  if "/Annots" in page: #Check if annotations exist
596
  for annot in page["/Annots"]:
597
  annot_obj = annot.get_object()
598
-
 
599
  # Assign each annotation a unique author
600
  if author_index < len(new_authors):
601
  annot_obj.update({"/T": TextStringObject(new_authors[author_index])})#Convert to PdfString
 
595
  if "/Annots" in page: #Check if annotations exist
596
  for annot in page["/Annots"]:
597
  annot_obj = annot.get_object()
598
+ if len(new_authors) == 0:
599
+ break
600
  # Assign each annotation a unique author
601
  if author_index < len(new_authors):
602
  annot_obj.update({"/T": TextStringObject(new_authors[author_index])})#Convert to PdfString