AddImageWatermark

<< Click to Display Table of Contents >>

Navigation:  Drivers API > IPXCPrinter Interface > Functions >

AddImageWatermark


 

PRO SDK Icon AddImageWatermark

 


 

The AddImageWatermark function is used to define image watermarks. The parameters of this function correspond to the parameters available in the PDF-XChange Drivers API's UI when new image watermarks are created. Please note that declarations and parameters are case-sensitive:

 

 

Declaration

 

C#

 

void AddImageWatermark(

   string sName,

   string sImageFileName,

   int dwTranscolor,

   int dwWidth,

   int dwHeight,

   int dwAlign,

   int xOffset,

   int yOffset,

   int nAngle,

   int dwOpacity,

   int dwFlags,

   int dwPlaceType,

   string sRange);

 

C++

 

HRESULT AddImageWatermark(

   [inBSTR sName,

   [inBSTR sImageFileName,

   [inlong dwTranscolor,

   [inlong dwWidth,

   [inlong dwHeight,

   [inlong dwAlign,

   [inlong xOffset,

   [inlong yOffset,

   [inlong nAngle,

   [inlong dwOpacity,

   [inlong dwFlags,

   [inlong dwPlaceType,

   [inBSTR sRange);

 

VB

 

Sub AddImageWatermark(

   sName As String,

   sImageFileName As String,

   dwTranscolor As Long,

   dwWidth As Long,

   dwHeight As Long,

   dwAlign As Long,

   xOffset As Long,

   yOffset As Long,

   nAngle As Long,

   dwOpacity As Long,

   dwFlags As Long,

   dwPlaceType As Long,

   sRange As String)

 

Parameters

 

sName

Specifies the watermark name. This name can be used in the Watermarks property. If there is already a watermark with the name specified then it will be overwritten.

 

sImageFileName

Specifies the path to the image file. The following formats are supported: BMP, PNG, JNG, JPEG, JPEG 2000, TIFF, JBIG, JBIG2, GIF, PCX, DCX, EMF and WMF. If a multipage image is specified then the first page will be used.

 

dwTranscolor

Specifies the transparent color for the image used. The pixels in the image of the color specified will be transparent in generated files. Specify -1 to disable this feature.

 

dwWidth

Specifies the width of the watermark. The image specified in sImageFileName will be resized to fit the area specified and will retain its aspect ratio.

 

dwHeight

Specifies the height of the watermark. The image specified in sImageFileName will be resized to fit the area specified and will retain its aspect ratio.

 

All other parameters of this function have the same meaning as the corresponding parameters of the AddTextWatermark function with the exception of the dwFlags parameter, which features two additional flags:

 

dwFlags

Specifies watermark placement and visibility. The following parameters are available and can be combined as desired:

 

 

BIT

 

 

VALUE

 

DEFINITION

 

8

 

 

256

 

If this bit is specified then the image will be rescaled to fit the page. The dwWidth and dwHeight parameters will be ignored.

 

9

 

 

512

 

 

If this bit is specified then the image used will not keep its aspect ration when scaling takes place.

 

 

Return Values

 

If the function fails then the return value is an error code.

 

If the function succeeds then the return value is S_OK.