Viewer getting freezes at the time of annotations injecting
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Viewer getting freezes at the time of annotations injecting
Hi,
I am using below event to inject annotations. It is always freezing.
private void axViewer_OnEvent(object sender, AxPDFXCviewAxLib._IPDFXCviewEvents_OnEventEvent e)
{
if (e.name.EndsWith("ContentReady") )
{
AnnotationsInject(); // this method we use to inject the annotions.
}
}
Looks like ContentReady is not happening properly. Event is rising before content is ready. Which is causing annotations get injected before the content ready hence freezing is happening.
Can you please help me on how to avoid this?
Thanks
Ram
I am using below event to inject annotations. It is always freezing.
private void axViewer_OnEvent(object sender, AxPDFXCviewAxLib._IPDFXCviewEvents_OnEventEvent e)
{
if (e.name.EndsWith("ContentReady") )
{
AnnotationsInject(); // this method we use to inject the annotions.
}
}
Looks like ContentReady is not happening properly. Event is rising before content is ready. Which is causing annotations get injected before the content ready hence freezing is happening.
Can you please help me on how to avoid this?
Thanks
Ram
- Tracker Supp-Stefan
- Site Admin
- Posts: 17907
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Viewer getting freezes at the time of annotations injecting
Hello Ram,
I've passed this to the lead dev that worked on the Viewer SDKs, and will post back again here as soon as I get any feedback from him.
In the mean time - can you please confirm which build of the Viewer SDK are you using? (You can check the version of the dll files)
Regards,
Stefan
I've passed this to the lead dev that worked on the Viewer SDKs, and will post back again here as soon as I get any feedback from him.
In the mean time - can you please confirm which build of the Viewer SDK are you using? (You can check the version of the dll files)
Regards,
Stefan
- Vasyl-Tracker Dev Team
- Site Admin
- Posts: 2353
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: Viewer getting freezes at the time of annotations injecting
Hi Ram.
Please details: how do you add comments into document? may be piece of AnnotationsInject() code?
Thanks.
Please details: how do you add comments into document? may be piece of AnnotationsInject() code?
Thanks.
Vasyl Yaremyn
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Re: Viewer getting freezes at the time of annotations injecting
Here it is :
private void AnnotationsInject()
{
AnnotationsInjectInterface();
AnnotationAddToViewer(note);
}
private void AnnotationsInjectInterface()
{
try
{
string injection = ResourceManager.GetString(".ViewerInterface.js");
_axViewer.RunJavaScript(injection);
}
catch (Exception ex)
{
ShowErrorMessage(ex); ;
}
}
private void AnnotationAddToViewer(DocumentNote NewAnnot)
{
string JSCommand = "AddAnnotation(\"" + System.Uri.EscapeUriString(SerializedAnnotation) + "\");";
_axViewer.RunJavaScript(JSCommand);
}
Please let me know if this is not sufficient.
Thanks
Rama
private void AnnotationsInject()
{
AnnotationsInjectInterface();
AnnotationAddToViewer(note);
}
private void AnnotationsInjectInterface()
{
try
{
string injection = ResourceManager.GetString(".ViewerInterface.js");
_axViewer.RunJavaScript(injection);
}
catch (Exception ex)
{
ShowErrorMessage(ex); ;
}
}
private void AnnotationAddToViewer(DocumentNote NewAnnot)
{
string JSCommand = "AddAnnotation(\"" + System.Uri.EscapeUriString(SerializedAnnotation) + "\");";
_axViewer.RunJavaScript(JSCommand);
}
Please let me know if this is not sufficient.
Thanks
Rama
- Vasyl-Tracker Dev Team
- Site Admin
- Posts: 2353
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: Viewer getting freezes at the time of annotations injecting
Hi Ram.
Try to call the RunJavaScript in synchronous mode:
HTH.
Try to call the RunJavaScript in synchronous mode:
Code: Select all
_axViewer.RunJavaScript(jscript, out res, 0, PXCVA_Sync);
Vasyl Yaremyn
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Re: Viewer getting freezes at the time of annotations injecting
I tried with below code. Still it is happening intermittently.
_axViewer.RunJavaScript(injection, out res, 0, 0);
Thanks
Rama
_axViewer.RunJavaScript(injection, out res, 0, 0);
Thanks
Rama
- Tracker Supp-Stefan
- Site Admin
- Posts: 17907
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Viewer getting freezes at the time of annotations injecting
Hi Rama,
Vasyl asked you to try with Synchronous mode - and the code you said you tried is not using the same parameter. Please try with what Vasyl suggested, and let us know if it helps!
Regards,
Stefan
Vasyl asked you to try with Synchronous mode - and the code you said you tried is not using the same parameter. Please try with what Vasyl suggested, and let us know if it helps!
Regards,
Stefan
Re: Viewer getting freezes at the time of annotations injecting
My bad, I should have mentioned this in my previous post.
I tried this _axViewer.RunJavaScript(jscript, out res, 0, PXCVA_Sync);
but PXCVA_Sync is not recognizing in the code. Looks like it requires some DLL needs to be added. That is the reason why i replaced that with integer 0 as method expecting integer.
public virtual void RunJavaScript(string script, out string result, int iD, int flags);
Please let me know, if i am missing anything.
Thanks
Rama
I tried this _axViewer.RunJavaScript(jscript, out res, 0, PXCVA_Sync);
but PXCVA_Sync is not recognizing in the code. Looks like it requires some DLL needs to be added. That is the reason why i replaced that with integer 0 as method expecting integer.
public virtual void RunJavaScript(string script, out string result, int iD, int flags);
Please let me know, if i am missing anything.
Thanks
Rama
Re: Viewer getting freezes at the time of annotations injecting
Do you guys have any update on this?
Do you have any sample projects in .Net which have some code snippets of how to show the pdf documents and record the annotations to database table. l
Thanks,
Rama
Do you have any sample projects in .Net which have some code snippets of how to show the pdf documents and record the annotations to database table. l
Thanks,
Rama
- Vasyl-Tracker Dev Team
- Site Admin
- Posts: 2353
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: Viewer getting freezes at the time of annotations injecting
Please look to our existing SDK-examples (../C#Examples/FindText project, for example). There PXCVA_Sync flag is used for some performance purposes..
HTH.
HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Re: Viewer getting freezes at the time of annotations injecting
I tried the code example you mentioned and still users getting freezing once in a while.
It happens at some percentage value as shown in the attached document.
It is happening as i mentioned earlier at the time of document opening and injecting the annotations.
Please provide me the code snippet of injecting saved annotations once the document got loaded.
The more users working on the Document viewer the more they see this freezing.
Thanks in advance for all your help on this.
Ram
It happens at some percentage value as shown in the attached document.
It is happening as i mentioned earlier at the time of document opening and injecting the annotations.
Please provide me the code snippet of injecting saved annotations once the document got loaded.
The more users working on the Document viewer the more they see this freezing.
Thanks in advance for all your help on this.
Ram
Re: Viewer getting freezes at the time of annotations injecting
Can you guys please expedite the help on this?
We are having more users complaining about freezing.
Thanks
Ram
We are having more users complaining about freezing.
Thanks
Ram
- Vasyl-Tracker Dev Team
- Site Admin
- Posts: 2353
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: Viewer getting freezes at the time of annotations injecting
Hi Rama.
Can you try to slightly change your code? Instead of changing the document inside from OnEvent(ContentReady) just try another 'lazy update' method like:
HTH
Can you try to slightly change your code? Instead of changing the document inside from OnEvent(ContentReady) just try another 'lazy update' method like:
Code: Select all
private void axViewer_OnEvent(object sender, AxPDFXCviewAxLib._IPDFXCviewEvents_OnEventEvent e)
{
if (e.name.EndsWith("ContentReady") )
{
// post ('lazy') event to itself to inject annotations (maybe by using window's PostMessage)
}
}
....
OnInjectAnnotsEvent(...)
{
AnnotationsInject();
}
Vasyl Yaremyn
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.