Watermark

Watermark can be text or image. The basic settings are: orientation, horizontal and vertical alignment and auto size. So the text or image can be placed in the lower right corner or centered on the page. The preview view provides a preliminary result for the current page in the preview. For simpler settings, you can use the appropriate methods described below.

Followed options is portrait, landscape, diagonal and rotate for orientaion. 

Horizontal and vertical alignment determines the basic position of the watermark in portrait and landscape orientation. Horizontal alignment can be: left, center, right or justify for text only. Vertical alignment can be: top, middle and bottom.

If the orientation is diagonal, then the watermark is placed in a line from the lower left corner to the upper right corner.

If setting the rotation option, you can also set the angle.

When the autosize option is checked, the watermark will adjust to the page size and orientation.

Print and export has separate watermark settings.

The watermark object

See to Watermark object or Watermark-Text object or Watermark-Image object.

Watermark text

Specific text watermark settings.

Watermark text examples

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

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