AddWatermarkText

Top  Previous  Next

The AddWatermarkText method adds a new text watermark, having the characteristics specified by the method parameters.

HRESULT AddWatermarkText(

[instring] LPCWSTR p_wsName, 

[instring] LPCWSTR p_wsText, 

[instring] LPCWSTR p_wsFont, 

[in] LONG p_nFontSize, 

[in] BOOL p_bBold, 

[in] BOOL p_bItalic, 

[in] BOOL p_bOutline, 

[in] COLORREF p_nColor,

[in] SHORT p_nRotation, 

[in] WORD p_nOpacity, 

[in] BOOL p_bVisible, 

[in] BOOL p_bFit, 

[in] LONG p_nMarginLeft, 

[in] LONG p_nMarginRight, 

[in] LONG p_nMarginTop, 

[in] LONG p_nMarginBottom, 

[in] BOOL p_bCenterHorizontally, 

[in] BOOL p_bCenterVertically, 

[in] BOOL p_bAlignRightMargin, 

[in] BOOL p_bAlignBottomMargin, 

[in] LONG p_nOriginLeft, 

[in] LONG p_nOriginTop, 

[in] WORD p_nPrintOn, 

[in] BOOL p_bPrintAsBackground, 

[instring] LPCWSTR p_wsPrintRange, 

[in] WORD p_nPrintPriority, 

[out] SHORT* p_nWatermark, 

[instring] LPCWSTR p_wsProfileName, 

[in] BOOL p_bPublicProfile

);

 

Parameters:

p_wsName,

[in, string] - watermark name

p_wsText

[in, string] - watermark text

p_wsFont

[in, string] - font name

p_bBold

[in] - flag, font is bold

p_bItalic

[in] - flag, font is italic

p_bOutline

[in] - flag, font is outline

p_nColor

[in] - font color

p_nRotation

[in] - text rotation angle

p_nOpacity

[in] - text color opacity

p_bVisible

[in] - flag if watermark is enabled

p_bFit

[in] - flag, image fit to margins

p_nMarginLeft

[in] - left margin

p_nMarginRight

[in] - right margin

p_nMarginTop

[in] - top margin

p_nMarginBottom

[in] - bottom margin

p_bCenterHorizontally

[in] - flag, image centered horizontally

p_bCenterVertically

[in] - flag, image centered vertically

p_bAlignRightMargin

[in] - flag, align image to right margin

p_bAlignBottomMargin

[in] - flag, align image to bottom margin

p_nOriginLeft

[in] - left origin position

p_nOriginTop

[in] - top origin position

p_nPrintOn

[in] - one of next values: 

0 - All pages

1 - First page

2 - Even pages

3 - Odd pages

4 - Page range

p_bPrintAsBackground

[in] - flag, print image as background

p_wsPrintRange

[in] - page range, like "2 - 5"

p_nPrintPriority

[in] - print priority of the image watermark

p_nWatermark

[out] - receives the new image watermark index

p_wsProfileName

[in, string] - pointer to a null terminated Unicode string containing the profile to modify. 

If this parameter is an empty string, the current active profile is used.

p_bPublicProfile

[in] - flag, profile is a public profile

 

Return values:

S_OK on success or COM error code

NV_NOT_INITIALIZED - Initialize was not called

NV_INVALID_WATERMARK_TXT - wrong text watermark index

NV_PUBLIC_PROFILE - you cannot change public profiles only on server