You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logging.error(f"download_result(): Failed to download file: {e}")
69
58
70
59
defappend_text_footer(self):
71
60
"""Append a new text footer to the PDF document."""
72
-
ifnotself._ensure_api_initialized():
73
-
return
74
-
75
-
new_footer=TextFooter(
76
-
background=True,
77
-
horizontal_alignment=HorizontalAlignment.CENTER,
78
-
text_alignment=TextHorizontalAlignment.CENTER,
79
-
value=Config.FOOTER_VALUE
80
-
)
81
-
82
-
try:
83
-
response=self.pdf_api.post_document_text_footer(
84
-
Config.PDF_DOCUMENT_NAME, new_footer
61
+
ifself.pdf_api:
62
+
new_footer=TextFooter(
63
+
background=True,
64
+
horizontal_alignment=HorizontalAlignment.CENTER,
65
+
text_alignment=TextHorizontalAlignment.CENTER,
66
+
value=Config.FOOTER_VALUE
85
67
)
86
-
ifresponse.code==200:
87
-
logging.info(f"append_text_footer(): Footer '{new_footer.value}' added to the document '{Config.PDF_DOCUMENT_NAME}'.")
88
-
else:
89
-
logging.error(f"append_text_footer(): Failed to add footer '{new_footer.value}' to the document '{Config.PDF_DOCUMENT_NAME}'. Response code: {response.code}")
90
-
exceptExceptionase:
91
-
logging.error(f"append_text_footer(): Error while adding footer: {e}")
68
+
69
+
try:
70
+
response=self.pdf_api.post_document_text_footer(
71
+
Config.PDF_DOCUMENT_NAME, new_footer
72
+
)
73
+
ifresponse.code==200:
74
+
logging.info(f"append_text_footer(): Footer '{new_footer.value}' added to the document '{Config.PDF_DOCUMENT_NAME}'.")
75
+
else:
76
+
logging.error(f"append_text_footer(): Failed to add footer '{new_footer.value}' to the document '{Config.PDF_DOCUMENT_NAME}'. Response code: {response.code}")
77
+
exceptExceptionase:
78
+
logging.error(f"append_text_footer(): Error while adding footer: {e}")
92
79
93
80
defappend_text_footer(self):
94
81
"""Append a new text footer to the PDF document."""
95
-
ifnotself._ensure_api_initialized():
96
-
return
97
-
98
-
new_footer=TextFooter(
99
-
background=True,
100
-
horizontal_alignment=HorizontalAlignment.CENTER,
101
-
text_alignment=TextHorizontalAlignment.CENTER,
102
-
value=Config.FOOTER_VALUE
103
-
)
104
-
105
-
try:
106
-
response=self.pdf_api.post_document_text_footer(
107
-
Config.PDF_DOCUMENT_NAME, new_footer
82
+
ifself.pdf_api:
83
+
new_footer=TextFooter(
84
+
background=True,
85
+
horizontal_alignment=HorizontalAlignment.CENTER,
86
+
text_alignment=TextHorizontalAlignment.CENTER,
87
+
value=Config.FOOTER_VALUE
108
88
)
109
-
ifresponse.code==200:
110
-
logging.info(f"append_text_footer(): Footer '{new_footer.value}' added to the document '{Config.PDF_DOCUMENT_NAME}'.")
111
-
else:
112
-
logging.error(f"append_text_footer(): Failed to add footer '{new_footer.value}' to the document '{Config.PDF_DOCUMENT_NAME}'. Response code: {response.code}")
113
-
exceptExceptionase:
114
-
logging.error(f"append_text_footer(): Error while adding footer: {e}")
89
+
90
+
try:
91
+
response=self.pdf_api.post_document_text_footer(
92
+
Config.PDF_DOCUMENT_NAME, new_footer
93
+
)
94
+
ifresponse.code==200:
95
+
logging.info(f"append_text_footer(): Footer '{new_footer.value}' added to the document '{Config.PDF_DOCUMENT_NAME}'.")
96
+
else:
97
+
logging.error(f"append_text_footer(): Failed to add footer '{new_footer.value}' to the document '{Config.PDF_DOCUMENT_NAME}'. Response code: {response.code}")
98
+
exceptExceptionase:
99
+
logging.error(f"append_text_footer(): Error while adding footer: {e}")
115
100
116
101
defappend_text_footer_page(self):
117
102
"""Append a new text footer to the page on PDF document."""
logging.info(f"append_text_footer_page(): Footer '{new_footer.value}' added to the page #{Config.PAGE_NUMBER}.")
134
-
else:
135
-
logging.error(f"append_text_footer_page(): Failed to add footer '{new_footer.value}' to the document #{Config.PAGE_NUMBER}. Response code: {response.code}")
136
-
exceptExceptionase:
137
-
logging.error(f"append_text_footer_page(): Error while adding footer: {e}")
logging.info(f"append_text_footer_page(): Footer '{new_footer.value}' added to the page #{Config.PAGE_NUMBER}.")
117
+
else:
118
+
logging.error(f"append_text_footer_page(): Failed to add footer '{new_footer.value}' to the document #{Config.PAGE_NUMBER}. Response code: {response.code}")
119
+
exceptExceptionase:
120
+
logging.error(f"append_text_footer_page(): Error while adding footer: {e}")
0 commit comments