Please enable JavaScript to view this site.

PDFX Reference

Navigation: GDI Print Directives > Watermarks

Defining an Image Watermark

Scroll Prev Top Next More

//PDFX,Watermarks.DefineImage, Wname, ImgSpec, TransColor, Width, Height, Align, Xoffset, Yoffset, Angle, Opacity, Flags, PlaceType, PageRange

Parameters

The parameters not listed below have the same meaning as for the Watermarks.DefineText directive, except Flags, which has two additional options:

Symbol

Values

Description

Wname

string

Name to assign to the watermark definition. You'll need to refer to this name in the Watermarks.Watermarks directive to invoke it.

ImgSpec

string

Specifies the file spec of the image to use for the watermark, in either AMOS-style or native format. Supported formats: BMP, PNG, JNG, JPEG, JPEG 2000, TIFF, JBIG, JBIG2, GIF, PCX, DCX, EMF, WMF.

TransColor

Integer (RGB)

Specifies the RGB value of the color within the image to treat as transparent. Use the standard A-ShellBASIC hex notation for RGB values (&hBBGGRR), e.g. &hFFFFFF for white.

Width, Height

integer

Specify the display width and height of the watermark, in tenths of millimeters. The image will be scaled to this size. Applicable only if the &h0100 bit in the Flags parameter is not set.

Flags

Integer (sum)

Indicates options relating to the placement and visibility of the watermark, and may combine zero or more of the following. Flags has the values as for the Watermarks.DefineText directive, with these two additional options:

 

&h0100

Scale the watermark to fit the page, ignoring the Width and Height parameters

 

&h0200

Don't retain aspect ratio when scaling.

 

Example

Definition of the image watermark shown in the example above.  It is named “WM2”, consists of the image file logo.png, the transparency color is pure white, i.e. RGB(255,255,255), the display width and height are both set to 180.0 millimeters, alignment set to both vertical and horizontal center (17), zero offsets, zero rotation angle, 15% opacity, flags 30 (background, visible in viewer, when exported and when printed), all pages.

//;define an image watermark

//PDFX,Watermarks.DefineImage,WM2,img:logo.png,&hffffff,1800,1800,17,0,0,0,15,30,0

//;enable watermarks

//PDFX,Watermarks.Enabled,True

//;And specify this watermark

//PDFX,Watermarks.Watermarks,WM2

 

Compatibility

New in PDFXv5.