op.annots.addNew
From PDF XChange PDF SDK
(→Sample) |
(→Sample) |
||
Line 24: | Line 24: | ||
== Sample == | == Sample == | ||
− | <pre class="brush:cpp">private void AddSquareAnnotation(PDFXEdit.IPXV_Document pDoc, PDFXEdit.PXV_Inst pInst) | + | <pre class="brush:cpp">//C# |
+ | private void AddSquareAnnotation(PDFXEdit.IPXV_Document pDoc, PDFXEdit.PXV_Inst pInst) | ||
{ | { | ||
if (pDoc == null) | if (pDoc == null) |
Revision as of 02:06, 9 December 2015
Overview
The operation overview...
Parameters
Name | Type | Description |
---|---|---|
Input | Array | Array of IUnknown -based objects.
|
Output | Array | Array of IUnknown -based objects.
|
Sample
//C# private void AddSquareAnnotation(PDFXEdit.IPXV_Document pDoc, PDFXEdit.PXV_Inst pInst) { if (pDoc == null) return; PDFXEdit.IPXC_Page pPage = pDoc.CoreDoc.Pages[0]; PDFXEdit.PXC_Rect rc; rc.left = 50; rc.right = 100; rc.top = 50; rc.bottom = 100; PDFXEdit.IPXS_Inst pSInt = (PDFXEdit.IPXS_Inst)pInst.GetExtension("PXS"); //Inserting square annotation as example uint nSquare = pSInt.StrToAtom("Square"); PDFXEdit.IPXC_Annotation pAnnot = pPage.InsertNewAnnot(nSquare, ref rc, 0); if (pAnnot == null) return; int nID = pInst.Str2ID("op.annots.addNew", false); PDFXEdit.IOperation pOp = pInst.CreateOp(nID); PDFXEdit.ICabNode input = pOp.Params.Root["Input"]; input.Add().v = pAnnot; pOp.Do(); }