op.document.insertEmptyPages

From PDF XChange PDF SDK
Jump to: navigation, search
 
Line 31: Line 31:
 
{
 
{
 
int nID = Inst.Str2ID("op.document.insertEmptyPages", false);
 
int nID = Inst.Str2ID("op.document.insertEmptyPages", false);
PDFXEdit.IOperation pOp = Inst.CreateOp(nID);
+
PDFXEdit.IOperation Op = Inst.CreateOp(nID);
PDFXEdit.ICabNode input = pOp.Params.Root["Input"];
+
PDFXEdit.ICabNode input = Op.Params.Root["Input"];
 
input.v = Doc;
 
input.v = Doc;
PDFXEdit.ICabNode options = pOp.Params.Root["Options"];
+
PDFXEdit.ICabNode options = Op.Params.Root["Options"];
 
options["PaperType"].v = 2; //Apply custom paper type  
 
options["PaperType"].v = 2; //Apply custom paper type  
 
options["Count"].v = 4; //Create 4 new pages
 
options["Count"].v = 4; //Create 4 new pages
Line 41: Line 41:
 
options["Location"].v = 1; //New pages will be inserted after first page
 
options["Location"].v = 1; //New pages will be inserted after first page
 
options["Position"].v = 0; //Page number
 
options["Position"].v = 0; //Page number
pOp.Do();
+
Op.Do();
 
}
 
}
 
</pre>
 
</pre>

Latest revision as of 02:05, 19 April 2016


Overview

The operation allows to add empty pages with given size and orientation into the document.

Parameters

Name Type Description
Input IUnknown IUnknown-based object containing the IPXC_Document where the empty pages will be added.
Output IUnknown IUnknown-based object containing the IPXC_Document where the empty pages were added.
Options Dictionary Dictionary with options of the operation.

Sample

//C#
private void InsertEmptyPages(PDFXEdit.IPXV_Document Doc, PDFXEdit.PXV_Inst Inst)
{
	int nID = Inst.Str2ID("op.document.insertEmptyPages", false);
	PDFXEdit.IOperation Op = Inst.CreateOp(nID);
	PDFXEdit.ICabNode input = Op.Params.Root["Input"];
	input.v = Doc;
	PDFXEdit.ICabNode options = Op.Params.Root["Options"];
	options["PaperType"].v = 2; //Apply custom paper type 
	options["Count"].v = 4; //Create 4 new pages
	options["Width"].v = 800; //Width of new pages
	options["Height"].v = 1200; //Height of new pages
	options["Location"].v = 1; //New pages will be inserted after first page
	options["Position"].v = 0; //Page number
	Op.Do();
}