Spaces:
Sleeping
Sleeping
Update Doors_Schedule.py
Browse files- Doors_Schedule.py +4 -2
Doors_Schedule.py
CHANGED
|
@@ -616,6 +616,8 @@ def modify_author_in_pypdf2(pdf_bytes, new_authors):
|
|
| 616 |
for annot in page["/Annots"]:
|
| 617 |
annot_obj = annot.get_object()
|
| 618 |
# Assign each annotation a unique author
|
|
|
|
|
|
|
| 619 |
if author_index < len(new_authors):
|
| 620 |
annot_obj.update({"/T": TextStringObject(new_authors[author_index])})#Convert to PdfString
|
| 621 |
author_index += 1 # Move to next author
|
|
@@ -676,8 +678,8 @@ def mainRun(schedule, plan, searcharray):
|
|
| 676 |
widths = get_widths_bb_format(cleaned_width, kelma)
|
| 677 |
if selected_columns_new.shape[1] == 2:
|
| 678 |
widths = []
|
| 679 |
-
for j in range(len(locations)):
|
| 680 |
-
|
| 681 |
final_pdf_bytes= process_pdf(plan, "final_output_width.pdf", new_data, widths)
|
| 682 |
|
| 683 |
|
|
|
|
| 616 |
for annot in page["/Annots"]:
|
| 617 |
annot_obj = annot.get_object()
|
| 618 |
# Assign each annotation a unique author
|
| 619 |
+
if len(new_authors) == 0:
|
| 620 |
+
break
|
| 621 |
if author_index < len(new_authors):
|
| 622 |
annot_obj.update({"/T": TextStringObject(new_authors[author_index])})#Convert to PdfString
|
| 623 |
author_index += 1 # Move to next author
|
|
|
|
| 678 |
widths = get_widths_bb_format(cleaned_width, kelma)
|
| 679 |
if selected_columns_new.shape[1] == 2:
|
| 680 |
widths = []
|
| 681 |
+
#for j in range(len(locations)):
|
| 682 |
+
# widths.append("Dimensions not found in schedule")
|
| 683 |
final_pdf_bytes= process_pdf(plan, "final_output_width.pdf", new_data, widths)
|
| 684 |
|
| 685 |
|