IPXC_Document::PlaceWatermark Method

From PDF XChange PDF SDK
Revision as of 04:10, 18 April 2016 by Palamar (Talk | contribs)

Jump to: navigation, search


Places watermarks with given parameters on pages specified with the PageIndexes.

Syntax

HRESULT PlaceWatermark([in]                      IBitSet*               pPageIndexes,
                       [in]                      IPXC_WatermarkParams*  pParams,
                       [in, defaultvalue(NULL)]  IProgressMon*          pProgress);

Parameters

pPageIndexes
[in] Pointer to IBitSet containing the page indexes where the watermarks will be placed at.
pParams
[in] Pointer to IPXC_WatermarkParams containing the new watermark parameters.
pProgress
[in, defaultvalue(NULL)] Pointer to IProgressMon containing the custom progress implementation.

Return Value

Returns S_OK if operation was successful or error code in other cases.

Sample

//C#
private void PlaceWatermark(PDFXEdit.IPXC_Document Doc, PDFXEdit.IPXC_Inst Inst)
{
	PDFXEdit.IAUX_Inst aInst = (PDFXEdit.IAUX_Inst)Inst.GetExtension("AUX");
	PDFXEdit.IBitSet bs = aInst.CreateBitSet(Doc.Pages.Count);
	PDFXEdit.IPXC_WatermarkParams wp = Inst.CreateWatermarkParams();
	bs.Set(0, 4); //We will place watermarks on first 4 pages
	wp.Text = "QWERTY";
	wp.FontSize = Convert.ToSingle(50);
	Doc.PlaceWatermark(bs, wp);
}

See Also

IPXC_Document