op.annots.addNew
From PDF XChange PDF SDK
(→Sample) |
|||
Line 24: | Line 24: | ||
== Sample == | == Sample == | ||
− | <pre class="brush:cpp">private void | + | <pre class="brush:cpp">private void AddSquareAnnotation(PDFXEdit.IPXV_Document pDoc, PDFXEdit.PXV_Inst pInst) |
{ | { | ||
if (pDoc == null) | if (pDoc == null) | ||
return; | return; | ||
− | int nID = pInst.Str2ID("op. | + | 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 popup as example | ||
+ | uint nPopup = pSInt.StrToAtom("Square"); | ||
+ | PDFXEdit.IPXC_Annotation pAnnot = pPage.InsertNewAnnot(nPopup, ref rc, 0); | ||
+ | if (pAnnot == null) | ||
+ | return; | ||
+ | int nID = pInst.Str2ID("op.annots.addNew", false); | ||
PDFXEdit.IOperation pOp = pInst.CreateOp(nID); | PDFXEdit.IOperation pOp = pInst.CreateOp(nID); | ||
PDFXEdit.ICabNode input = pOp.Params.Root["Input"]; | PDFXEdit.ICabNode input = pOp.Params.Root["Input"]; | ||
− | input. | + | input.Add().v = pAnnot; |
− | + | ||
− | + | ||
− | + | ||
pOp.Do(); | pOp.Do(); | ||
} | } | ||
</pre> | </pre> |
Revision as of 00:43, 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
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 popup as example uint nPopup = pSInt.StrToAtom("Square"); PDFXEdit.IPXC_Annotation pAnnot = pPage.InsertNewAnnot(nPopup, 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(); }