op.addContent

From PDF XChange PDF SDK
Jump to: navigation, search
(Sample)
 
Line 30: Line 30:
 
private void AddContent(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst, PDFXEdit.IPXC_Content Content)
 
private void AddContent(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst, PDFXEdit.IPXC_Content Content)
 
{
 
{
int nID = pdfCtl.Inst.Str2ID("op.addContent", false);
+
int nID = Inst.Str2ID("op.addContent", false);
PDFXEdit.IOperation Op = pdfCtl.Inst.CreateOp(nID);
+
PDFXEdit.IOperation Op = Inst.CreateOp(nID);
 
PDFXEdit.ICabNode input = Op.Params.Root["Input"];
 
PDFXEdit.ICabNode input = Op.Params.Root["Input"];
input.Add().v = pdfCtl.Doc.CoreDoc;
+
input.Add().v = Doc.CoreDoc;
 
PDFXEdit.ICabNode options = Op.Params.Root["Options"];
 
PDFXEdit.ICabNode options = Op.Params.Root["Options"];
 
options["Content"].v = Content;
 
options["Content"].v = Content;

Latest revision as of 07:27, 15 April 2016


Overview

The operation allows to modify content of the documents pages.

Parameters

Name Type Description
Input Array Array of IUnknown-based objects containing the IPXC_Document which content will be modified.
Output Array Array of IUnknown-based objects containing the IPXC_Document that had it's content modified.
Options Dictionary Dictionary with options of the operation.

Sample

//C#
private void AddContent(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst, PDFXEdit.IPXC_Content Content)
{
	int nID = Inst.Str2ID("op.addContent", false);
	PDFXEdit.IOperation Op = Inst.CreateOp(nID);
	PDFXEdit.ICabNode input = Op.Params.Root["Input"];
	input.Add().v = Doc.CoreDoc;
	PDFXEdit.ICabNode options = Op.Params.Root["Options"];
	options["Content"].v = Content;
	options["TargetPage"].v = 0;
	options["InsertClone"].v = true;
	Op.Do();
}