IPXC_Document::PlaceWatermark Method

From PDF XChange PDF SDK
Jump to: navigation, search
m (Automatic page editing by robot)
Line 3: Line 3:
 
{{#customTitle:IPXC_Document::PlaceWatermark Method}}
 
{{#customTitle:IPXC_Document::PlaceWatermark Method}}
 
{{#parentPage:PXV:IPXC_Document#Methods|PlaceWatermark|method}}
 
{{#parentPage:PXV:IPXC_Document#Methods|PlaceWatermark|method}}
{{ToWrite}}
 
 
{{ToReview}}
 
{{ToReview}}
  
The method of interface of PDF-XChange Editor SDK.
+
Places watermarks with given parameters on pages specified with the [[PXV:IBitSet|PageIndexes]].
  
 
== Syntax ==
 
== Syntax ==
Line 15: Line 14:
 
== Parameters ==
 
== Parameters ==
 
;pPageIndexes
 
;pPageIndexes
:[in]  Pointer to [[PXV:IBitSet|IBitSet]].
+
:[in]  Pointer to [[PXV:IBitSet|IBitSet]] containing the page indexes where the watermarks will be placed at.
 
;pParams
 
;pParams
:[in]  Pointer to [[PXV:IPXC_WatermarkParams|IPXC_WatermarkParams]].
+
:[in]  Pointer to [[PXV:IPXC_WatermarkParams|IPXC_WatermarkParams]] containing the new watermark parameters.
 
;pProgress
 
;pProgress
:[in, defaultvalue(NULL)]  Pointer to [[PXV:IProgressMon|IProgressMon]].
+
:[in, defaultvalue(NULL)]  Pointer to [[PXV:IProgressMon|IProgressMon]] containing the custom progress implementation.
  
 
== Return Value ==
 
== Return Value ==
 
Returns S_OK if operation was successful or error code in other cases.
 
Returns S_OK if operation was successful or error code in other cases.
 +
 +
== Sample ==
 +
<pre class="brush:c#">//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);
 +
}
 +
</pre>
  
 
== See Also ==
 
== See Also ==
 
[[PXV:IPXC_Document|IPXC_Document]]
 
[[PXV:IPXC_Document|IPXC_Document]]

Revision as of 05:10, 18 April 2016


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