Skip to content

Commit fded853

Browse files
Update appendStamps.py
1 parent 0cad31c commit fded853

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Uses-Cases/Stamps/add/appendStamps.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import json
33
import logging
44
from pathlib import Path
5-
from asposepdfcloud import ApiClient, PdfApi, Stamp, AsposeResponse
5+
from asposepdfcloud import ApiClient, PdfApi, Stamp, AsposeResponse, HorizontalAlignment, StampType
66

77
# Configure logging
88
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
@@ -78,18 +78,18 @@ def add_document_stamps(self):
7878
""" Adds a text stamp to a specific page in a PDF document. """
7979

8080
text_stamp: Stamp = Stamp(
81-
type="Text",
82-
background=True,
83-
horizontal_alignment="Center",
84-
text_alignment="Center",
81+
type = StampType.TEXT,
82+
background = True,
83+
horizontal_alignment = HorizontalAlignment.CENTER,
84+
text_alignment = HorizontalAlignment.CENTER,
8585
value=Config.STAMP_TEXT
8686
)
8787

8888
image_stamp: Stamp = Stamp(
89-
type = "Image",
89+
type = StampType.IMAGE,
9090
background = True,
91-
horizontal_alignment = "Center",
92-
text_alignment = "Center",
91+
horizontal_alignment = HorizontalAlignment.CENTER,
92+
text_alignment = HorizontalAlignment.CENTER,
9393
value = "NEW IMAGE STAMP",
9494
file_name = Config.IMAGE_STAMP_FILE,
9595
y_indent = Config.IMAGE_STAMP_LLY,
@@ -113,4 +113,4 @@ def add_document_stamps(self):
113113
pdf_stamps.upload_document()
114114
pdf_stamps.upload_file(Config.IMAGE_STAMP_FILE)
115115
pdf_stamps.add_document_stamps()
116-
pdf_stamps.download_result()
116+
pdf_stamps.download_result()

0 commit comments

Comments
 (0)