IPXS_Inst::StrToAtom Method

From PDF XChange PDF SDK
Jump to: navigation, search
m (Automatic page editing by robot)
 
Line 3: Line 3:
 
{{#customTitle:IPXS_Inst::StrToAtom Method}}
 
{{#customTitle:IPXS_Inst::StrToAtom Method}}
 
{{#parentPage:PXV:IPXS_Inst#Methods|StrToAtom|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 ==
Line 14: Line 13:
 
== Parameters ==
 
== Parameters ==
 
;sString
 
;sString
:[in]  Value of LPWSTR.
+
:[in]  Value of LPWSTR containing the string representation of the atom.
 
;nAtom
 
;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();
}

See Also

IPXS_Inst