IPXS_Inst::StrToAtom Method

From PDF XChange PDF SDK
Jump to: navigation, search
m (Automatic page editing by robot)
 
(8 intermediate revisions by one other user not shown)
Line 1: Line 1:
 +
__NOTOC__
 
[[Category:Editor]]
 
[[Category:Editor]]
 
{{#customTitle:IPXS_Inst::StrToAtom Method}}
 
{{#customTitle:IPXS_Inst::StrToAtom Method}}
{{#parentPage:PXV:IPXS_Inst|method}}
+
{{#parentPage:PXV:IPXS_Inst#Methods|StrToAtom|method}}
{{ToWrite}}
+
 
{{ToReview}}
 
{{ToReview}}
  
The method of interface of PDF-XChange Editor SDK.
+
Gets atom ID by it's string representation.
  
 
== Syntax ==
 
== Syntax ==
<pre class="brush:cpp;gutter:false">HRESULT StrToAtom([in] LPWSTR pString, [out, retval] ULONG* pAtom);</pre>
+
<pre class="brush:cpp;gutter:false">HRESULT StrToAtom([in]           LPWSTR sString,
 +
                  [out, retval] ULONG* nAtom);</pre>
  
 
== Parameters ==
 
== Parameters ==
;''pString''
+
;sString
:[in]  Value of LPWSTR.
+
:[in]  Value of LPWSTR containing the string representation of the atom.
;''pAtom''
+
;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 ==
See also [[PXV:IPXS_Inst|IPXS_Inst]].
+
[[PXV:IPXS_Inst|IPXS_Inst]]

Latest revision as of 00:53, 22 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();
}

See Also

IPXS_Inst