IPXC_Annotation::Actions Property
From PDF XChange PDF SDK
m (Automatic page editing by robot) |
m (Automatic page editing by robot) |
||
(8 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
+ | __NOTOC__ | ||
[[Category:Editor]] | [[Category:Editor]] | ||
{{#customTitle:IPXC_Annotation::Actions Property}} | {{#customTitle:IPXC_Annotation::Actions Property}} | ||
− | {{#parentPage:PXV:IPXC_Annotation|Actions | + | {{#parentPage:PXV:IPXC_Annotation#Properties|Actions|property}} |
− | + | ||
− | + | ||
− | Property '''Actions''' | + | Property '''Actions''' returns or sets [[PXV:IPXC_ActionsList|list of actions]] associated with the annotation for the specific [[PXV:PXC_TriggerType|trigger]]. For most annotations only <code>Trigger_Up</code> is used. |
== Syntax == | == Syntax == | ||
<pre class="brush:cpp;gutter:false">HRESULT get_Actions([in] PXC_TriggerType nTrigger, | <pre class="brush:cpp;gutter:false">HRESULT get_Actions([in] PXC_TriggerType nTrigger, | ||
− | [out, retval] IPXC_ActionsList** | + | [out, retval] IPXC_ActionsList** pActions); |
HRESULT put_Actions([in] PXC_TriggerType nTrigger, | HRESULT put_Actions([in] PXC_TriggerType nTrigger, | ||
− | [in] IPXC_ActionsList* | + | [in] IPXC_ActionsList* pActions); |
</pre> | </pre> | ||
== Parameters == | == Parameters == | ||
;nTrigger | ;nTrigger | ||
− | :[in] | + | :[in] Specifies the [[PXV:PXC_TriggerType|trigger]] for which list of action should set or retrieved. |
+ | |||
+ | == Sample == | ||
+ | <pre class="brush:c#">//C# | ||
+ | public bool HasInvalidPaths(PDFXEdit.IPXC_Annotation annot) | ||
+ | { | ||
+ | uint invalidCount = 0; | ||
+ | uint GoTo = pxsInst.StrToAtom("GoTo"); | ||
+ | uint GoToR = pxsInst.StrToAtom("GoToR"); | ||
+ | uint Launch = pxsInst.StrToAtom("Launch"); | ||
+ | PDFXEdit.IPXC_ActionsList actions = annot.get_Actions(PDFXEdit.PXC_TriggerType.Trigger_Up); | ||
+ | for (uint k = 0; k < actions.Count; k++) | ||
+ | { | ||
+ | if ((actions[k].Type == GoTo) || (actions[k].Type == GoToR)) | ||
+ | { | ||
+ | PDFXEdit.IPXC_Action_Goto actionGoTo = (PDFXEdit.IPXC_Action_Goto)actions[k]; | ||
+ | if (actionGoTo.IsValid == false) | ||
+ | { | ||
+ | invalidCount++; | ||
+ | } | ||
+ | else if (actions[k].Type == GoToR) | ||
+ | { | ||
+ | PDFXEdit.IPXC_FileSpec path = actionGoTo.Target; | ||
+ | if (File.Exists(path.DIPath) == false) | ||
+ | invalidCount++; | ||
+ | } | ||
+ | |||
+ | } | ||
+ | else if (actions[k].Type == Launch) | ||
+ | { | ||
+ | PDFXEdit.IPXC_Action_Launch actionLaunch = (PDFXEdit.IPXC_Action_Launch)actions[k]; | ||
+ | if (actionLaunch.IsValid == false) | ||
+ | { | ||
+ | invalidCount++; | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | PDFXEdit.IPXC_FileSpec path = actionLaunch.FileSpec; | ||
+ | if (path == null) | ||
+ | { | ||
+ | if (File.Exists(actionLaunch.FileName) == false) | ||
+ | invalidCount++; | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | if (File.Exists(path.DIPath) == false) | ||
+ | invalidCount++; | ||
+ | } | ||
+ | |||
+ | } | ||
+ | } | ||
+ | } | ||
+ | return (invalidCount > 0); | ||
+ | } | ||
+ | </pre> | ||
== See Also == | == See Also == | ||
− | + | [[PXV:IPXC_Annotation|IPXC_Annotation]] |
Latest revision as of 03:55, 20 February 2017
Property Actions returns or sets list of actions associated with the annotation for the specific trigger. For most annotations only Trigger_Up
is used.
Syntax
HRESULT get_Actions([in] PXC_TriggerType nTrigger, [out, retval] IPXC_ActionsList** pActions); HRESULT put_Actions([in] PXC_TriggerType nTrigger, [in] IPXC_ActionsList* pActions);
Parameters
- nTrigger
- [in] Specifies the trigger for which list of action should set or retrieved.
Sample
//C# public bool HasInvalidPaths(PDFXEdit.IPXC_Annotation annot) { uint invalidCount = 0; uint GoTo = pxsInst.StrToAtom("GoTo"); uint GoToR = pxsInst.StrToAtom("GoToR"); uint Launch = pxsInst.StrToAtom("Launch"); PDFXEdit.IPXC_ActionsList actions = annot.get_Actions(PDFXEdit.PXC_TriggerType.Trigger_Up); for (uint k = 0; k < actions.Count; k++) { if ((actions[k].Type == GoTo) || (actions[k].Type == GoToR)) { PDFXEdit.IPXC_Action_Goto actionGoTo = (PDFXEdit.IPXC_Action_Goto)actions[k]; if (actionGoTo.IsValid == false) { invalidCount++; } else if (actions[k].Type == GoToR) { PDFXEdit.IPXC_FileSpec path = actionGoTo.Target; if (File.Exists(path.DIPath) == false) invalidCount++; } } else if (actions[k].Type == Launch) { PDFXEdit.IPXC_Action_Launch actionLaunch = (PDFXEdit.IPXC_Action_Launch)actions[k]; if (actionLaunch.IsValid == false) { invalidCount++; } else { PDFXEdit.IPXC_FileSpec path = actionLaunch.FileSpec; if (path == null) { if (File.Exists(actionLaunch.FileName) == false) invalidCount++; } else { if (File.Exists(path.DIPath) == false) invalidCount++; } } } } return (invalidCount > 0); }