Hey everyone, I dont work with javascript that much and have looked all over for a solution. I am using an activeX plugin that uses JS to interact with the control.
The activeX allows Tiff files to be viewed in IE. I am wanting to have a set of lables display something like "Page 1 of 10".
Below you will see the code the fendor provided for next page/previous page. I also read there help file and says to use "BITIFF.GetNumberOfImagesInTiffFile" to get the number of pages. Do you see anything with the JS that would allways bring back TotalNumberofPages = "-1"?
The activeX allows Tiff files to be viewed in IE. I am wanting to have a set of lables display something like "Page 1 of 10".
Below you will see the code the fendor provided for next page/previous page. I also read there help file and says to use "BITIFF.GetNumberOfImagesInTiffFile" to get the number of pages. Do you see anything with the JS that would allways bring back TotalNumberofPages = "-1"?
Code:
function OnNext()
{
PageNum=PageNum+1;
setLabelText("lblCurrentPage", PageNum);
var hDib = BITIFF.LoadTiffIntoDIB(LocalFile, PageNum, false);
BIDISP.hDib = hDib;
if(PageNum>0)
PreviousPage.style.visibility="visible";
if(PageNum>=BITIFF.GetNumberOfImagesInTiffFile(LocalFile)-1)
NextPage.style.visibility="hidden";
else
NextPage.style.visibility="visible";
}
function OnPrevious()
{
PageNum=PageNum-1;
setLabelText("lblCurrentPage", PageNum);
var hDib = BITIFF.LoadTiffIntoDIB(LocalFile, PageNum, false);
BIDISP.hDib = hDib;
if(PageNum<=0)
PreviousPage.style.visibility="hidden";
else
PreviousPage.style.visibility="visible";
if(PageNum<BITIFF.GetNumberOfImagesInTiffFile(LocalFile)-1)
NextPage.style.visibility="visible";
}
function OnLoad()
{
PreviousPage.style.visibility="hidden";
BITIFF.DownloadImageFileURL(FilePath, LocalFile);
var TotalNumberofPages = BITIFF.GetNumberOfImagesInTiffFile(LocalFile);
setLabelText("lblCurrentPage", "1");
setLabelText("lblLastPage", TotalNumberofPages);
}