IPXS_Inst::StrToAtom Method
From PDF XChange PDF SDK
m (Automatic page editing by robot) |
|||
(6 intermediate revisions by one other user not shown) | |||
Line 2: | Line 2: | ||
[[Category:Editor]] | [[Category:Editor]] | ||
{{#customTitle:IPXS_Inst::StrToAtom Method}} | {{#customTitle:IPXS_Inst::StrToAtom Method}} | ||
− | {{#parentPage:PXV:IPXS_Inst|StrToAtom | + | {{#parentPage:PXV:IPXS_Inst#Methods|StrToAtom|method}} |
− | + | ||
{{ToReview}} | {{ToReview}} | ||
− | + | Gets atom ID by it's string representation. | |
== Syntax == | == Syntax == | ||
− | <pre class="brush:cpp;gutter:false">HRESULT StrToAtom([in] LPWSTR | + | <pre class="brush:cpp;gutter:false">HRESULT StrToAtom([in] LPWSTR sString, |
− | [out, retval] ULONG* | + | [out, retval] ULONG* nAtom);</pre> |
== Parameters == | == Parameters == | ||
− | ; | + | ;sString |
− | :[in] Value of LPWSTR. | + | :[in] Value of LPWSTR containing the string representation of the atom. |
− | ; | + | ;nAtom |
− | :[out, retval] Pointer to ULONG. | + | :[out, retval] Pointer to ULONG containing the resulting atom ID. |
== Return Value == | == Return Value == | ||
Returns S_OK if operation was successful or error code in other cases. | Returns S_OK if operation was successful or error code in other cases. | ||
+ | |||
+ | == Sample == | ||
+ | <pre class="brush:c#">//C# | ||
+ | private void RemoveSquareAnnotations(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst) | ||
+ | { | ||
+ | PDFXEdit.IPXS_Inst pSInt = (PDFXEdit.IPXS_Inst)Inst.GetExtension("PXS"); | ||
+ | uint nSquareAtom = pSInt.StrToAtom("Square"); | ||
+ | int nID = Inst.Str2ID("op.annots.delete", false); | ||
+ | PDFXEdit.IOperation Op = Inst.CreateOp(nID); | ||
+ | PDFXEdit.ICabNode input = Op.Params.Root["Input"]; | ||
+ | //Filling the operation with the annotations of Square type | ||
+ | for (uint i = 0; i < Doc.CoreDoc.Pages.Count; i++) | ||
+ | { | ||
+ | PDFXEdit.IPXC_Page page = Doc.CoreDoc.Pages[i]; | ||
+ | uint nCnt = page.GetAnnotsCount(); | ||
+ | for (uint j = 0; j < nCnt; j++) | ||
+ | { | ||
+ | PDFXEdit.IPXC_Annotation annot = page.GetAnnot(j); | ||
+ | if (annot.Type == nSquareAtom) | ||
+ | input.Add().v = annot; | ||
+ | } | ||
+ | } | ||
+ | Op.Do(); | ||
+ | } | ||
+ | </pre> | ||
== See Also == | == See Also == | ||
− | [[PXV:IPXS_Inst|IPXS_Inst]] | + | [[PXV:IPXS_Inst|IPXS_Inst]] |
Latest revision as of 23:53, 21 April 2016
Gets atom ID by it's string representation.
Syntax
HRESULT StrToAtom([in] LPWSTR sString, [out, retval] ULONG* nAtom);
Parameters
- sString
- [in] Value of LPWSTR containing the string representation of the atom.
- nAtom
- [out, retval] Pointer to ULONG containing the resulting atom ID.
Return Value
Returns S_OK if operation was successful or error code in other cases.
Sample
//C# private void RemoveSquareAnnotations(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst) { PDFXEdit.IPXS_Inst pSInt = (PDFXEdit.IPXS_Inst)Inst.GetExtension("PXS"); uint nSquareAtom = pSInt.StrToAtom("Square"); int nID = Inst.Str2ID("op.annots.delete", false); PDFXEdit.IOperation Op = Inst.CreateOp(nID); PDFXEdit.ICabNode input = Op.Params.Root["Input"]; //Filling the operation with the annotations of Square type for (uint i = 0; i < Doc.CoreDoc.Pages.Count; i++) { PDFXEdit.IPXC_Page page = Doc.CoreDoc.Pages[i]; uint nCnt = page.GetAnnotsCount(); for (uint j = 0; j < nCnt; j++) { PDFXEdit.IPXC_Annotation annot = page.GetAnnot(j); if (annot.Type == nSquareAtom) input.Add().v = annot; } } Op.Do(); }