Forum rules DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
I have noticed that if I execute any javascript and then close my application it seems to leave my application hanging (resulting in the application .exe process still running).
Below is my code, which works fine with no errors. Do I need to dispose of anything prior to closing my application?
Private Sub getAnnotStatus(ByVal annotOID As String)
Dim tOutputJS As String = Nothing
Dim JS As New StringBuilder
JS.AppendLine("//JS Code to search for an annotation and get status of it where StateInModel is Review")
JS.AppendLine("//the JS output is passed to the SDK IString Res")
JS.AppendLine("this.syncAnnotScan();")
JS.AppendLine("var annots = this.getAnnots({")
JS.AppendLine("nSortBy: ANSB_Author,")
JS.AppendLine("bReverse: true")
JS.AppendLine("});")
JS.AppendLine("")
JS.AppendLine("var stateResults;")
JS.AppendLine("var returnResults;")
JS.AppendLine("returnResults = """";")
JS.AppendLine("var selAnnots = [")
If getSelected = True Then
Dim sel As PDFXEdit.IPXV_DocSelection = Me.docPreview.Doc.ActiveSel
Dim annotSel As PDFXEdit.IPXV_AnnotSelection = CType(sel, PDFXEdit.IPXV_AnnotSelection)
If annotSel IsNot Nothing Then
For i As UInteger = 0 To annotSel.Items.Count - 1
JS.AppendLine("""" & annotSel.Items(i).Name & """" & ",")
Next
End If
Else
JS.AppendLine("""" & annotOID & """")
End If
JS.AppendLine("];")
JS.AppendLine("for (var i = 0; i < annots.length; i++) {")
JS.AppendLine("for (var j = 0; j < selAnnots.length; j++) {")
JS.AppendLine("if (selAnnots[j] == annots[i].name) {")
JS.AppendLine("var states = annots[i].getStateInModel(""Review"");")
JS.AppendLine("var state;")
JS.AppendLine("stateResults = """";")
JS.AppendLine("if (states.length > 0) {")
JS.AppendLine("for (k = 0; k < states.length; k++) {")
JS.AppendLine("var s = states[k].state;")
JS.AppendLine("state = s;")
JS.AppendLine("stateResults = ""State="" + s;")
JS.AppendLine("}")
JS.AppendLine("} else {")
JS.AppendLine("stateResults = ""State=None"";")
JS.AppendLine("}")
JS.AppendLine("if (states.length === 0);")
JS.AppendLine("returnResults = returnResults + stateResults + ""~"";")
JS.AppendLine("res = returnResults;")
JS.AppendLine("}")
JS.AppendLine("}")
JS.AppendLine("}")
Dim res As PDFXEdit.IString = Me.docPreview.Inst.CreateString()
Try
Me.docPreview.Inst.ExecuteJS(Me.docPreview.Doc, JS.ToString, PDFXEdit.PXV_ActionTriggerClass.PAEC_External, PDFXEdit.PXV_ActionTriggerSubclass.PAESC_Exec, Nothing, res)
Catch ex As Exception
Console.WriteLine("Error getting annotation state: " & convertErr(ex))
End Try
End Sub
This has been passed to the correct developer (Roman), and he will look at it as soon as he comes to work, and will post with further advise shortly after!
I was expecting Roman would post directly here.
He is in the Canadian office - so I didn't speak with him directly yesterday, but will chase this one up again today and try to get you some feedback asap!
I have an issue now, I have created a .Net sample project with my code and this all works fine and closes the application cleanly. However on my main project if the JS code is run it does not close kill the .exe process. It is as if something is not getting disposed correctly, however I have debugged the application and the PDFXChange Dispose method is getting fired and runs without any errors. I know you are probably unable to help with this as it could be a many things, but is there anything methods, debugging I can try? I would send you my main project, but I use various DevExpress third party controls.
Public Sub OnEvent(pSender As PDFXEdit.IUIX_Obj, pEvent As PDFXEdit.IUIX_Event) Implements PDFXEdit.IUIX_ObjImpl.OnEvent
And these do not get fired if I run the JS, therefore the JS command must be doing something behind the scenes that is leaving something open / exposed stopping the exe process from closing.
Well, we still will have to wait for Roman's response whether you will have to send him your project or will the information that you have provided give him another idea on the cause of this.
Hi Simon,
Can you then provide a memory dump of your hung application?
To do this (assuming you run Windows 7 or later) Open Windows Task Manager (Ctrl+Shift+Esc), locate your application process (either on Processes or Details tab), right-click it and select "Create dump file". You will get a window with the path to the created dump file. Please send me this file (zipped). I think it would be better to upload the file to some file sharing online service (like Google Drive or DropBox) and send me the link. If your application memory may contain private data, please send me the link in private message.
Hi all. I'm running into the exact same issue. This is what I discovered:
1> this only happens when control isn't shown
2> seems to happen on certain text annotations (especially on the rect property) when control isn't visible