op.document.updateBackground

From PDF XChange PDF SDK
Jump to: navigation, search
 
Line 25: Line 25:
 
| Dictionary with options of the operation.
 
| Dictionary with options of the operation.
 
|}
 
|}
 +
 +
== Sample ==
 +
<pre class="brush:c#">//C#
 +
private void UpdateBackground(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst)
 +
{
 +
int nID = Inst.Str2ID("op.document.updateBackground", false);
 +
PDFXEdit.IOperation Op = Inst.CreateOp(nID);
 +
var input = Op.Params.Root["Input"];
 +
input.v = Doc.CoreDoc;
 +
PDFXEdit.ICabNode options = Op.Params.Root["Options"];
 +
options["PagesRange.Type"].v = "All";
 +
options["Type"].v = 0; //Color
 +
PDFXEdit.IAUX_Inst aInst = (PDFXEdit.IAUX_Inst)Inst.GetExtension("AUX");
 +
PDFXEdit.IColor clr = aInst.CreateColor(PDFXEdit.ColorType.ColorType_RGB);
 +
clr.SetRGB(1.0f, 0.0f, 1.0f);
 +
options["Color"].v = clr.Value; //Color
 +
Op.Do();
 +
}
 +
</pre>

Latest revision as of 07:53, 20 April 2016


Overview

The operation allows to update the current background in the document.

Parameters

Name Type Description
Input IUnknown IUnknown-based object containing the IPXC_Document which background will be updated.
Output IUnknown IUnknown-based object containing the IPXC_Document which background was updated. Not yet implemented.
Options Dictionary Dictionary with options of the operation.

Sample

//C#
private void UpdateBackground(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst)
{
	int nID = Inst.Str2ID("op.document.updateBackground", false);
	PDFXEdit.IOperation Op = Inst.CreateOp(nID);
	var input = Op.Params.Root["Input"];
	input.v = Doc.CoreDoc;
	PDFXEdit.ICabNode options = Op.Params.Root["Options"];
	options["PagesRange.Type"].v = "All";
	options["Type"].v = 0; //Color
	PDFXEdit.IAUX_Inst aInst = (PDFXEdit.IAUX_Inst)Inst.GetExtension("AUX");
	PDFXEdit.IColor clr = aInst.CreateColor(PDFXEdit.ColorType.ColorType_RGB);
	clr.SetRGB(1.0f, 0.0f, 1.0f);
	options["Color"].v = clr.Value; //Color
	Op.Do();
}