op.document.resizePages

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:cpp">private void ResizePageToA2(PDFXEdit.IPXV_Document pDoc, PDFXEdit.PXV_Inst pInst)
 +
{
 +
if (pDoc == null)
 +
return;
 +
int nID = pInst.Str2ID("op.document.resizePages", false);
 +
PDFXEdit.IOperation pOp = pInst.CreateOp(nID);
 +
PDFXEdit.ICabNode input = pOp.Params.Root["Input"];
 +
input.v = pDoc;
 +
PDFXEdit.ICabNode options = pOp.Params.Root["Options"];
 +
options["PaperType"].v = 1; //Standard values table
 +
options["StdPaperIndex"].v = 2; //A2
 +
pOp.Do();
 +
}
 +
</pre>

Revision as of 01:37, 9 December 2015


Overview

The operation allows to change pages media box's values with or without scaling of the pages contents.

Parameters

Name Type Description
Input IUnknown IUnknown-based object containing the IPXC_Document which pages will have their media box changed.
Output IUnknown IUnknown-based object containing the IPXC_Document which pages had their media box changed.
Options Dictionary Dictionary with options of the operation.

Sample

private void ResizePageToA2(PDFXEdit.IPXV_Document pDoc, PDFXEdit.PXV_Inst pInst)
{
	if (pDoc == null)
		return;
	int nID = pInst.Str2ID("op.document.resizePages", false);
	PDFXEdit.IOperation pOp = pInst.CreateOp(nID);
	PDFXEdit.ICabNode input = pOp.Params.Root["Input"];
	input.v = pDoc;
	PDFXEdit.ICabNode options = pOp.Params.Root["Options"];
	options["PaperType"].v = 1; //Standard values table
	options["StdPaperIndex"].v = 2; //A2
	pOp.Do();
}