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);
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