op.document.addBackground
From PDF XChange PDF SDK
(Automatic page editing by robot) |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
{{#customTitle:op.document.addBackground}} | {{#customTitle:op.document.addBackground}} | ||
{{#parentPage:PXV:Operations|op.document.addBackground|operation}} | {{#parentPage:PXV:Operations|op.document.addBackground|operation}} | ||
− | |||
{{ToReview}} | {{ToReview}} | ||
== Overview == | == Overview == | ||
− | The operation | + | The operation allows to add background to the document. |
== Parameters == | == Parameters == | ||
Line 15: | Line 14: | ||
|- | |- | ||
| class="op_param_name" | Input | | class="op_param_name" | Input | ||
− | | style="text-align:center" | | + | | style="text-align:center" | IUnknown |
− | | | + | | <code>IUnknown</code>-based object containing the [[PXV:IPXC_Document|IPXC_Document]] which the background will be applied to. |
|- | |- | ||
| class="op_param_name" | Output | | class="op_param_name" | Output | ||
− | | style="text-align:center;" | | + | | style="text-align:center;" | IUnknown |
− | | | + | | <code>IUnknown</code>-based object containing the [[PXV:IPXC_Document|IPXC_Document]] with added background. Not yet implemented. |
|- | |- | ||
| class="op_param_name" | [[PXV:op_document_addBackground_Options|Options]] | | class="op_param_name" | [[PXV:op_document_addBackground_Options|Options]] | ||
Line 26: | Line 25: | ||
| Dictionary with options of the operation. | | Dictionary with options of the operation. | ||
|} | |} | ||
+ | |||
+ | == Sample == | ||
+ | <pre class="brush:c#">//C# | ||
+ | private void AddBackground(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst) | ||
+ | { | ||
+ | int nID = Inst.Str2ID("op.document.addBackground", 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 23:06, 18 April 2016
Overview
The operation allows to add background to the document.
Parameters
Name | Type | Description |
---|---|---|
Input | IUnknown | IUnknown -based object containing the IPXC_Document which the background will be applied to.
|
Output | IUnknown | IUnknown -based object containing the IPXC_Document with added background. Not yet implemented.
|
Options | Dictionary | Dictionary with options of the operation. |
Sample
//C# private void AddBackground(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst) { int nID = Inst.Str2ID("op.document.addBackground", 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(); }