PDF-XChange - Tracker PDF Viewer - TIFF-XChange - Image-XChange - XMF-XChange - Raster-XChange - Support

Moderators: Tracker Support, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Ivan - Tracker Software, Tracker Supp-Stefan

 
Rama
User
Topic Author
Posts: 6
Joined: Wed Jul 12, 2017 6:23 pm

Viewer getting freezes at the time of annotations injecting

Wed Jul 12, 2017 6:35 pm

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
 
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 11538
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Viewer getting freezes at the time of annotations injecting

Fri Jul 14, 2017 4:17 pm

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
 
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 1824
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Viewer getting freezes at the time of annotations injecting

Fri Jul 14, 2017 9:10 pm

Hi Ram.

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.
 
Rama
User
Topic Author
Posts: 6
Joined: Wed Jul 12, 2017 6:23 pm

Re: Viewer getting freezes at the time of annotations injecting

Tue Jul 25, 2017 7:05 pm

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
 
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 1824
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Viewer getting freezes at the time of annotations injecting

Wed Jul 26, 2017 4:41 pm

Hi Ram.

Try to call the RunJavaScript in synchronous mode:

_axViewer.RunJavaScript(jscript, out res,  0, PXCVA_Sync);

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.
 
Rama
User
Topic Author
Posts: 6
Joined: Wed Jul 12, 2017 6:23 pm

Re: Viewer getting freezes at the time of annotations injecting

Tue Aug 01, 2017 10:39 pm

I tried with below code. Still it is happening intermittently.
_axViewer.RunJavaScript(injection, out res, 0, 0);

Thanks
Rama
 
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 11538
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Viewer getting freezes at the time of annotations injecting

Wed Aug 02, 2017 9:26 am

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
 
Rama
User
Topic Author
Posts: 6
Joined: Wed Jul 12, 2017 6:23 pm

Re: Viewer getting freezes at the time of annotations injecting

Wed Aug 02, 2017 6:31 pm

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
 
Rama
User
Topic Author
Posts: 6
Joined: Wed Jul 12, 2017 6:23 pm

Re: Viewer getting freezes at the time of annotations injecting

Tue Aug 15, 2017 9:14 pm

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
 
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 1824
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Viewer getting freezes at the time of annotations injecting

Wed Aug 16, 2017 6:29 pm

Please look to our existing SDK-examples (../C#Examples/FindText project, for example). There PXCVA_Sync flag is used for some performance purposes..

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.

Who is online

Users browsing this forum: No registered users and 1 guest