Java Script: [0x80010105], The server threw an exception

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

billfz
User
Posts: 7
Joined: Fri Sep 07, 2007 6:26 pm

Java Script: [0x80010105], The server threw an exception

Post by billfz »

When I run certain java script code l get a failure "[0x80010105], The server threw an exception" intermittently.

version: v2.0.41.5
OS: Windows 2003
Language: C++

javascript code

Code: Select all


function clearannotation()
{
	var numpages = this.numPages;
  	for (var nPageIndex=0; nPageIndex < numpages; nPageIndex++)
	{
		var annots = this.getAnnots(nPageIndex);
		if (annots != null)
		{
			for (var i = 0; i < annots.length; i++) 
				annots[i].destroy();
		}
	}
}

function addannotation()
{
	var ESignObject = this.addAnnot({page: 0,type: "FreeText", name: "test", contents: "test",width: 1, alignment: 1,fillColor: color.white, rect: [200,100,450,120],style: "D", dash: [3,2]});
} 

function getannotation()
{
	var annots=this.getAnnots(0);
	if(annots!=null)
	{
		for(var i=0;i<annots.length;i++)
		{
			var props=annots[i].getProps();
                                                var name = props["name"];
			if(name=="test")
			{
				var rectstring;
				rectstring = props["rect"];
				return rectstring;
			}
		}
	}

	return 0;
}


clearannotation();
addannotation();

var location = getannotation();
util.printf(location);
This issue can be reproduced using PDFViewerActiveTestC.exe - I haven't tried it with other samples.

Steps to reproduce
1) Open PDFViewerActiveTestC.exe
2) Go to the Documents tab and open a PDF. The issue seems to occur with any PDF.
3) Go to the Javascript tab and paste in the javascript code which clears all annotations, adds an annotation, and then gets the annotation location.
4) Run this javascript several times; it may throw the exception at this point.
5) If it doesn't, go back to the Documents tab and close the active document, then reopen it and try step 4 -5 again until it crashes. It shouldn't take more than two or three times.

This is a critical issue to our product. I've whittled the issue down to the getannotation() function, and potentially annots.getProps(); line.

thanks
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3586
Joined: Thu Jul 08, 2004 10:36 pm

Re: Java Script: [0x80010105], The server threw an exception

Post by Ivan - Tracker Software »

Hi,

This Bug is fixed and the fix will be available in the new build.
PDF-XChange Co Ltd. (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.