Watermark text
Methods:
version
This method set horizontal and vertical aligment.
Parameters:
m.luHAlign – horizontal alignment; values: "left" (0), "center" (1), "right" (2), "justify" (3)
m.luVAlign – vertical algnment; values: "top" (0), "middle" (1), "bottom" (2)
This method set text orientation.
Parameters:
m.luOrientaion – orientation; values: "portrait" (0), "landscape" (1), "diagonal" (2), "rotate" (3)
m.lnAngle – angle in degree for rotate orientaion
This method set color.
Parameters:
m.liFCR – foreground color red
m.liFCG – foreground color green
m.liFCB – foreground color blue
m.liBCR – background color red
m.liBCG – background color green
m.liBCB – background color blue
Parameters:
m.liFGC – foreground color
m.liBGC – background color
This method set font.
Parameters:
m.lcFontName – font name
m.lnFontSize – font size, minimal value is 4, maximal vaue is 140
m.lcFontSTYLE – font style, "N" - normal, "I" - italic ,"B" - bold, "S" - strike through, "U" - underline
m.liFontEmbedded – embedding flag, 0 - none, 1 - subset, 2 - all, 3 - unicode
This method set text.
Parameters:
m.lcText – water mark text.
m.liCodePage – codepage
m.llAutoSize – auto size flag. If value is true, then font size will be calculated by page size.
Properties:
version
Foreground color red.
Watermark image
Specific mask settings are intended for either PDF or printing or export to images - restrictions are described below. A mask can be a color (a range of two colors), a clipping mask (a black and white image to which the source image is cropped), or an alpha mask (a grayscale image defining translucency at a specific point in the source image).
Methods:
version
This method set horizontal and vertical aligment.
Parameters:
m.luHAlign – horizontal alignment; values: "left" (0), "center" (1), "right" (2)
m.luVAlign – vertical algnment; values: "top" (0), "middle" (1), "bottom" (2)
This method set text orientation.
Parameters:
m.luOrientaion – orientation; values: "portrait" (0), "landscape" (1), "diagonal" (2), "rotate" (3)
m.lnAngle – angle in degree for rotate orientaion
This method set image.
Parameters:
m.lcText – water mark text.
m.llAutoSize – auto size flag. If value is true, then font size will be calculated by page size.
m.lnAdjustType – adjust mode; 0 - clip picture, 1 - stretch picture, retain shape, 2 - stretch picture, fill frame
m.lcMaskColor – Mask color for creating transparent image (for PDF, print and preview).
m.lcSMaskImage – Soft mask image - apply alpha mask to watermark image.
m.lcMaskImage – Mask image - create transparent image or cut watermark image.
m.llNEG – Flag of image in negative colors (for PDF, print and preview).
m.liPagePicture – Page picture - for TIFF image.
Properties:
version
Adjust mode:
0 … clip picture
1 … stretch picture, retain shape
2 … stretch picture, fill frame
Watermark text
Specific text watermark settings.
Watermark text examples
Code Block |
---|
USE invoices
ORDER customer
LOCAL m.loSession, m.lnRetval, m.loXFF, m.loPreview, m.loScripts
m.loSession=EVALUATE([xfrx("XFRX#LISTENER")])
m.lnRetVal = m.loSession.SetParams("",,,,,,"XFF") && no name = just in memory
IF m.lnRetVal = 0
REPORT FORM invoices OBJECT m.loSession
m.loXFF = m.loSession.oxfDocument
*
* initialize the previewer
* SET CLASSLIB TO xfrxlib ADDITIVE
m.loPreview = CREATEOBJECT("frmMPPreviewer")
m.loPreview.windowType = 0
m.loPreview.iBook = 0
WITH loPreview.oExportOptions
.oWM.lShowPreview=.T.
.oWM.iMode=1
.oWM.oText.SetText("W A T E R M A R K", ,.T.)
.oWM.oText.SetFont("Tahoma", 30, "B")
.oWM.oText.SetColor(125, 125, 125)
.oWM.SetOrientation("diagonal")
ENDWITH
m.loPreview.PreviewXFF(loXFF)
m.loPreview.show(1)
ENDIF
|
Watermark image
Specific mask settings are intended for either PDF or printing or export to images - restrictions are described below. A mask can be a color (a range of two colors), a clipping mask (a black and white image to which the source image is cropped), or an alpha mask (a grayscale image defining translucency at a specific point in the source image).
Watermark image examples
Code Block |
---|
USE invoices
ORDER customer
LOCAL m.loSession, m.lnRetval, m.loXFF, m.loPreview, m.loScripts
m.loSession=EVALUATE([xfrx("XFRX#LISTENER")])
m.lnRetVal = m.loSession.SetParams("",,,,,,"XFF") && no name = just in memory
IF m.lnRetVal = 0
REPORT FORM invoices OBJECT m.loSession
m.loXFF = m.loSession.oxfDocument
*
* initialize the previewer
* SET CLASSLIB TO xfrxlib ADDITIVE
m.loPreview = CREATEOBJECT("frmMPPreviewer")
m.loPreview.windowType = 0
m.loPreview.iBook = 0
WITH loPreview.oExportOptions
.oWM.lShowPreview=.T.
.oWM.iMode=2
.oWM.oImage.SetImage(FULLPATH("xfrx.jpg"), .T.)
.oWM.SetOrientation("diagonal")
ENDWITH
m.loPreview.PreviewXFF(loXFF)
m.loPreview.show(1)
ENDIF |
|