The ITextWatermark interface is used to configure the application of text watermarks to output file pages.
Properties
Integer BackgroundColor
Defines watermark background color (as an RGB value). It is both readable and writable.
Integer BackgroundTransparency
Defines watermark background transparency (as a percentage value). Valid range: between 0 and 100. It is both readable and writable.
Enum EmbossingMethod
Defines the method of applying a watermark to document pages. It is both readable and writable.
Constant
Value
Description
WME_STAMP
0
Watermark is applied over the document
WME_WATERMARK
2
Watermark is "mixed" in with the document
WME_BACKGROUND
3
Watermark is placed underneath the document
Boolean FontBold
Is a flag indicating whether the watermark font should be bold. It is both readable and writable.
Value
Description
TRUE
Watermark font is highlighted in bold
FALSE
Watermark font is not highlighted in bold
Integer FontColor
Defines watermark font color (as an RGB value). It is both readable and writable.
Boolean FontItalic
Is a flag indicating whether the watermark font should be italic. It is both readable and writable.
Value
Description
TRUE
Watermark font is in italics
FALSE
Watermark font is not italicized.
String FontName
Defines the name of the font to be used to apply the watermark. The font should be installed on the system. It is both readable and writable.
Integer FontSize
Determines watermark font size. It is both readable and writable.
Integer FontTransparency
Defines watermark font transparency (as a percentage value). Valid range: between 0 and 100. It is both readable and writable.
Boolean FontUnderline
Is a flag indicating whether the watermark should be underlined. It is both readable and writable.
Value
Description
TRUE
Watermark font is underlined
FALSE
Watermark font is not underlined.
Integer MarginsX
Defines watermark horizontal margins, i. e. offsets (in pixels) from the right and left edges of the page to be taken into account when placing the watermark. It is both readable and writable.
Integer MarginsY
Defines watermark vertical margins, i. e. offsets (in pixels) from the top and bottom edges of the page to be taken into account when placing the watermark. It is both readable and writable.
Enum PositionX
Defines watermark horizontal alignment on the pages of a document. It is both readable and writable.
Constant
Value
Description
POS_LEFT
0xFFFFFFFF
Watermark is left-justified on page
POS_CENTER
0
Watermark is centered on page
POS_RIGHT
1
Watermark is right-justified on page
Enum PositionY
Defines watermark vertical alignment on the pages of a document. It is both readable and writable.
Constant
Value
Description
POS_TOP
0xFFFFFFFF
Watermark is aligned with the top of the page
POS_CENTER
0
Watermark is vertically centered on page
POS_BOTTOM
1
Watermark is aligned with the bottom of the page
Enum Rotation
Defines watermark rotation angle on a page. It is both readable and writable.
Value
Description
-90
Watermark is rotated 90 degrees counterclockwise
-45
Watermark is rotated 45 degrees counterclockwise
0
Watermark is not rotated.
45
Watermark is rotated 45 degrees clockwise
90
Watermark is rotated 90 degrees clockwise
Boolean Stretch
Defines whether a watermark will be stretched to cover the entire page in a document. It is both readable and writable.
Value
Description
TRUE
Watermark will be stretched to cover entire page
FALSE
Watermark will not be stretched
String Text
Contains the text which will be applied to output file pages as a watermark. It is both readable and writable.
The following macros may be used:
Macro
Description
Example Value
&[DocName(0)]
Document Name
My Document
&[DocName(1)]
Uppercase Document Name
MY DOCUMENT
&[DocName(2)]
Lowercase Document Name
my document
&[Page(0)]
Page Number
3
&[Page(2)] . . . &[Page(6)]
Page number of between 2 and 6 digits
05
000005
&[Year(0)]
Current 4-digit year
2009
&[Year(1)]
Current 2-digit year
09
&[Month(0)]
Current month as text
February
&[Month(1)]
Current month as 2-digit number
02
&[Month(2)]
Current month as Roman numerals
II
&[MonthDay(0)]
Current date
3
&[MonthDay(1)]
Current 2-digit date
03
&[WeekDay(0)]
Current day of week as text
Tuesday
&[WeekDay(1)]
Current day of week as number
3
&[WeekDay(2)]
Current day of week as 2-digit number
03
&[Date(0)]
Current full date
Tuesday, February 03, 2009
&[Date(1)]
Current full date as dd.mm.yyyy
03.02.2009
&[Date(2)]
Current complete date as dd.mm.yy
03.02.09
&[Hour(0)]
Current hour in 24-hour format
21
&[Hour(1)]
Current hour in 12-hour format
09
&[Hour(2)]
am or pm
am
&[Min(0)]
Current minutes
31
&[Sec(0)]
Current seconds
38
&[Time(0)]
Current time in hh-mm-ss format
09-31-38
&[Time(1)]
Current time in hh-mm (24-Hour) format
21-31
&[Time(2)]
Current time in hh-mm (12-Hour) format
09-31
Boolean TextBorder
Defines whether the watermark text will be placed in a rectangular box. It is both readable and writable.
Value
Description
TRUE
Watermark text will have a border
FALSE
Watermark text will have no border
Examples
Visual Basic 6
Dim objUDC As IUDC
Dim itfPrinter As IUDCPrinter
Dim itfProfile As IProfile
Set objUDC = New UDC.APIWrapper
Set itfPrinter = objUDC.Printers("Universal Document Converter")
Set itfProfile = itfPrinter.Profile
itfProfile.Watermark.Mode = WM_TEXT
itfProfile.Watermark.TextWatermark.BackgroundColor = RGB(0, 255, 0)
itfProfile.Watermark.TextWatermark.BackgroundTransparency = 50
itfProfile.Watermark.TextWatermark.EmbossingMethod = WME_STAMP
itfProfile.Watermark.TextWatermark.FontBold = True
itfProfile.Watermark.TextWatermark.FontColor = RGB(255, 0, 0)
itfProfile.Watermark.TextWatermark.FontItalic = True
itfProfile.Watermark.TextWatermark.FontName = "Arial"
itfProfile.Watermark.TextWatermark.FontSize = 72
itfProfile.Watermark.TextWatermark.FontTransparency = 50
itfProfile.Watermark.TextWatermark.FontUnderline = False
itfProfile.Watermark.TextWatermark.MarginsX = 10
itfProfile.Watermark.TextWatermark.MarginsY = 10
itfProfile.Watermark.TextWatermark.PositionX = POS_CENTER
itfProfile.Watermark.TextWatermark.PositionY = POS_CENTER
itfProfile.Watermark.TextWatermark.Rotation = 45
itfProfile.Watermark.TextWatermark.Stretch = False
itfProfile.Watermark.TextWatermark.Text = "Top Secret"
itfProfile.Watermark.TextWatermark.TextBorder = True