op.document.cropPages
From PDF XChange PDF SDK
(→Sample) |
|||
Line 32: | Line 32: | ||
return; | return; | ||
int nID = pInst.Str2ID("op.document.cropPages", false); | int nID = pInst.Str2ID("op.document.cropPages", false); | ||
− | PDFXEdit.IOperation pOp = | + | PDFXEdit.IOperation pOp = pInst.CreateOp(nID); |
PDFXEdit.ICabNode input = pOp.Params.Root["Input"]; | PDFXEdit.ICabNode input = pOp.Params.Root["Input"]; | ||
input.v = pDoc; | input.v = pDoc; | ||
Line 45: | Line 45: | ||
return; | return; | ||
int nID = pInst.Str2ID("op.document.cropPages", false); | int nID = pInst.Str2ID("op.document.cropPages", false); | ||
− | PDFXEdit.IOperation pOp = | + | PDFXEdit.IOperation pOp = pInst.CreateOp(nID); |
PDFXEdit.ICabNode input = pOp.Params.Root["Input"]; | PDFXEdit.ICabNode input = pOp.Params.Root["Input"]; | ||
input.v = pDoc; | input.v = pDoc; |
Revision as of 00:37, 9 December 2015
Overview
The operation allows to change the crop box of the document's pages.
Parameters
Name | Type | Description |
---|---|---|
Input | IUnknown | IUnknown -based object containing the IPXC_Document which pages will be cropped.
|
Output | IUnknown | IUnknown -based object containing the IPXC_Document which pages were cropped.
|
Options | Dictionary | Dictionary with options of the operation. |
Sample
private void RemoveWhiteSpaces(PDFXEdit.IPXV_Document pDoc, PDFXEdit.PXV_Inst pInst) { if (pDoc == null) return; int nID = pInst.Str2ID("op.document.cropPages", 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["Flags"].v = 256; //Remove white spaces pOp.Do(); } private void CropByOffsets(PDFXEdit.IPXV_Document pDoc, PDFXEdit.PXV_Inst pInst) { if (pDoc == null) return; int nID = pInst.Str2ID("op.document.cropPages", 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["Flags"].v = 2; //Crop Box //Specifying offsets options["IsOffset"].v = true; options["CropBox.top"].v = 50; options["CropBox.left"].v = 50; options["CropBox.right"].v = 50; options["CropBox.bottom"].v = 50; pOp.Do(); }