Skip to content

Commit

Permalink
fixed add new addr dict
Browse files Browse the repository at this point in the history
  • Loading branch information
jozefbaranec committed Dec 12, 2024
1 parent e819454 commit 587dd08
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/process_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def update_table_sum(
print("[" + img + "] no summary generated")
return

attr_set = False
attr_dict = None
for index in reversed(range(elem.GetNumAttrObjects())):
attr_obj = elem.GetAttrObject(index)
Expand All @@ -108,6 +107,8 @@ def update_table_sum(

if not attr_dict:
attr_dict = doc.CreateDictObject(False)
attr_dict.PutName("O", "Table")
elem.AddAttrObj(attr_dict)

old_summary = attr_dict.GetText("Summary")
if overwrite or not old_summary:
Expand All @@ -116,6 +117,7 @@ def update_table_sum(




def browse_table_tags(
parent: PdsStructElement,
doc: PdfDoc,
Expand Down

0 comments on commit 587dd08

Please sign in to comment.