@@ -18,6 +18,8 @@ const configParams = {
18
18
IMAGE_STAMP_FILE : "sample.png" ,
19
19
LOCAL_RESULT_DOCUMENT_NAME : "output_sample.pdf" ,
20
20
PAGE_NUMBER : 2 , // Your document page number...
21
+ TEXT_STAMP_VALUE : "NEW TEXT STAMP" ,
22
+ IMAGE_TEXT_STAMP_VALUE : "NEW IMAGE STAMP" ,
21
23
IMAGE_STAMP_LLY : 800 ,
22
24
IMAGE_STAMP_WIDTH : 24 ,
23
25
IMAGE_STAMP_HEIGHT : 24 ,
@@ -45,22 +47,22 @@ const pdfStamps = {
45
47
46
48
async addStamps ( ) {
47
49
const textStamp = new Stamp ( ) ;
48
- textStamp . type = " Text" ;
50
+ textStamp . type = StampType . Text ;
49
51
textStamp . background = true ;
50
- textStamp . horizontalAlignment = " Center" ;
51
- textStamp . textAlignment = " Center" ;
52
- textStamp . value = "NEW TEXT STAMP" ;
52
+ textStamp . horizontalAlignment = HorizontalAlignment . Center ;
53
+ textStamp . textAlignment = HorizontalAlignment . Center ;
54
+ textStamp . value = configParams . TEXT_STAMP_VALUE ;
53
55
54
56
const imageStamp = new Stamp ( ) ;
55
- imageStamp . type = " Image" ;
56
- imageStamp . background = true ;
57
- imageStamp . horizontalAlignment = " Center" ;
58
- imageStamp . textAlignment = " Center" ;
59
- imageStamp . value = "NEW IMAGE STAMP" ;
60
- imageStamp . fileName = configParams . IMAGE_STAMP_FILE ;
61
- imageStamp . yIndent = configParams . IMAGE_STAMP_LLY ;
62
- imageStamp . width = configParams . IMAGE_STAMP_WIDTH ;
63
- imageStamp . height = configParams . IMAGE_STAMP_HEIGHT ;
57
+ imageStamp . type = StampType . Image ;
58
+ imageStamp . background = true ;
59
+ imageStamp . horizontalAlignment = HorizontalAlignment . Center ;
60
+ imageStamp . textAlignment = HorizontalAlignment . Center ;
61
+ imageStamp . value = configParams . IMAGE_TEXT_STAMP_VALUE ;
62
+ imageStamp . fileName = configParams . IMAGE_STAMP_FILE ;
63
+ imageStamp . yIndent = configParams . IMAGE_STAMP_LLY ;
64
+ imageStamp . width = configParams . IMAGE_STAMP_WIDTH ;
65
+ imageStamp . height = configParams . IMAGE_STAMP_HEIGHT ;
64
66
65
67
const addResult = await pdfApi . postDocumentTextStamps ( configParams . PDF_DOCUMENT_NAME , [ textStamp ] )
66
68
. then ( async ( ) => {
0 commit comments