I've been testing your free version of the activeX viewer in the app that I'm developing. Everything works great, except for 2 things that I just can't figure out why; and both problems are to do with the two event types, i.e., PXCVA_OnNamedNotify and PXCVA_OnDisplayPrompt
1. Delete Selected Feeze on KeyUp:
- I set axCoPDFXCview1.SetProperty("Notifications.Keyboard.Filter", "Up", 0); in the Form_Load.
- I get the keycode for the delete button -> axCoPDFXCview1.GetProperty("Notifications.Keyboard.Code", out vKeyCode, 0);
- and I do a ExecuteCommand(33136); i.e., comand code for deleteSelected.
- The selected object (whether it is a line, text, highlight, etc) just freezes and the app freezes as well.
Initially I thought it might be something to do with my app, so I tried it in one of your sample apps and it did the same. If instead I put a button and do the ExecuteCommand(33136); on the click event it works fine. I know I'm missing something here in the event types, because I have a similar situation in the second issue I'm having, detailed below.
2. Prompts.ConfirmDocumentSave:
In my app, the user modifies the document with highlights etc, and leaves the document to move to another window or panel of the app. When doing so I intercept the Prompts.ConfirmDocumentSave event and display our custom prompt for the user to save the document. If the user clicks "Yes" to save, I save the document and bypass the viewer's default save prompt; but for some reason the default save prompt triggers and the app freezes. An excerpt of the code is below:
case (int)PDFXCviewAxLib.PXCVA_EventTypes.PXCVA_OnDisplayPrompt:
switch (e.name) {
case "Prompts.ConfirmDocumentSave":
DialogResult res = MessageBox.Show("Would you like to save changes?",
"Save",
MessageBoxButtons.YesNo);
if (res == DialogResult.Yes) {
axCoPDFXCview1.SaveDocument(mDocID);// if I comment this line out, it doesn't freeze, but still displays the default save prompt
axCoPDFXCview1.SetProperty("Prompts.ConfirmDocumentIncSave.UserChoice",
6, 0);
}
else {
axCoPDFXCview1.SetProperty("Prompts.ConfirmDocumentIncSave.UserChoice",
7, 0);
}
break;
}
These are so far the only two issues that have stumped me; and I know it's something I'm overlooking. Once I resolve these two issues, I intend to purchase the license and deploy the app for beta testing. Please advise.
Thank you.