Multiple watermark additions using the api
Posted: Fri Apr 13, 2018 10:55 am
Hi,
I am using the PXCComLib.CPXCControlEx to create a printer object using windev and was trying to apply watermarks to that. I was able to
add the watermark but it was working only for single watermark.
The following is the code snippet. It works for a single watermark but multiple watermarks cannot be added.When used as single watermarks both works.
gPrinter is a dynamic object in windev which refers to the printer created using
gPrinter = gFactory>>Printer("", "PDF-XChange Test", "", "")
gPrinter>>Option("Watermarks.Enabled")=True
gPrinter>>AddTextWatermark("WM", "HelloWaterMark 0", "Verdana", 400, True, False,0, 0, 0, 8, 100,100,0,100,30,0,"1,2")
gPrinter>>AddTextWatermark("WM1", "Hello WaterMark 1", "Verdana", 400, True, False,0, 0, 0, 1, 0,0,45,100,30,0,"1,2")
I tried setting using these two options
gPrinter>>Option("Watermarks.Watermarks")="WM,WM1"
gPrinter>>Option("Watermarks.Watermarks","WM,WM1")
I am not quite sure about the details what is given in PDF manual in sections watermark
"Watermarks String A comma to separate the list of watermark names should be added to the document.Each of these watermark should be added using AddTextWatermark or AddImageWatermark methods.Default value: empty string."
I am using the PXCComLib.CPXCControlEx to create a printer object using windev and was trying to apply watermarks to that. I was able to
add the watermark but it was working only for single watermark.
The following is the code snippet. It works for a single watermark but multiple watermarks cannot be added.When used as single watermarks both works.
gPrinter is a dynamic object in windev which refers to the printer created using
gPrinter = gFactory>>Printer("", "PDF-XChange Test", "", "")
gPrinter>>Option("Watermarks.Enabled")=True
gPrinter>>AddTextWatermark("WM", "HelloWaterMark 0", "Verdana", 400, True, False,0, 0, 0, 8, 100,100,0,100,30,0,"1,2")
gPrinter>>AddTextWatermark("WM1", "Hello WaterMark 1", "Verdana", 400, True, False,0, 0, 0, 1, 0,0,45,100,30,0,"1,2")
I tried setting using these two options
gPrinter>>Option("Watermarks.Watermarks")="WM,WM1"
gPrinter>>Option("Watermarks.Watermarks","WM,WM1")
I am not quite sure about the details what is given in PDF manual in sections watermark
"Watermarks String A comma to separate the list of watermark names should be added to the document.Each of these watermark should be added using AddTextWatermark or AddImageWatermark methods.Default value: empty string."