ViewONE Pro .....................................................................................................................................................................10
Apple Macintosh users (JavaScript)....................................................................................................................................10
Apple Macintosh users (HTML).........................................................................................................................................11
Setting up Windows 2003 server..............................................................................................................12
Security note: Change since ViewONE 3.0.99 Standard and 1.0.99 Pro............................................................................16
General Applet Control...................................................................................................................................... 17
Opening documents and images........................................................................................................................ 19
Specifying an Annotations File.......................................................................................................................... 26
Saving documents and images........................................................................................................................... 27
setRotationArray(int angle, int page)..................................................................................................................................39
setMagBounds(int x, int y, int width, int height).................................................................................................................51
Selection and clipboard...................................................................................................................................... 55
Toolbars and Buttons......................................................................................................................................... 61
Menus and keys................................................................................................................................................... 68
The Event Handler and Event Handling.......................................................................................................... 82
Events handler change in ViewONE Version 3..................................................................................................................83
Events ids and descriptions.................................................................................................................................................84
Testing your Event Handler ................................................................................................................................................88
The MayScript tag...............................................................................................................................................................88
Page 7
Introduction
ViewONE is a Java applet that extends your web b row ser so that y ou can vi ew, zoom,
magnify, scroll, pan, rotate and print your images and image do cuments quickly and
easily.
This document is the ViewONE JavaScript Manual and covers how to use and w hat
options are available for the ViewONE JavaScript API.
This document is designed to be used in conjunction w ith the ViewONE H TML and
Installation Manual.
(Please note: This manual does not cover the Jav ascript API for Anno tations, please see
the Applet Annotations Configuration Manual)
For further information about ViewONE please consult the following documents…
• ViewONE User Manual
• ViewONE HTML and Installation Manual
• ViewONE Annotations User Manual
• ViewONE Annotations Installation HTML and JavaScript Manual
• Various White Papers for in-depth analysis of specific a reas
• Latest ViewONE release notes found at
http://www.daeja.com/pub/start/release.html
7777
Page 8
The Applet user interface
File
Open,
Close and
Save
Toolbar
Toggle
Print Page, Document
and Page Range
Zoom Area, Zoom In, Zoom Out,
Magnify, Zoom 100%, Fit to Width,
Fit to Height, Best Fit, Rotate
Clockwise, Rotate
Counterclockwise, Rotate 180, Flip
Horizontally, Flip Vertically, Invert
and Help
New Window
Scroll to
First,
Previous,
Next and
Last Page
Vertical
scrollbar
Image Area
Drag mouse
to pan
image
Document
Information
View Fullpage,
Thumbnails,
Two pages
Thumbs-left,
Thumbs bottom,
Thumbs right and
Thumbs top
Enhance mode
Help and progress
captions appear here
Horizontal scrollbar
Adjust Brightne ss
8888
Page 9
Installing ViewONE
HTML:
To install ViewONE on your web site you must first download the ‘Update’ zip file from the
Daeja web site. This can be found by visiting www .daeja.com/pub/start/downloads.html
After unzipping the downloaded file you should have a directory named “v1files”. Thi s
directory contains the essential files required to install and use ViewONE.
Copy all files found in the “v1files” directory to your web server, pre ferably in a separa te
directory similarly named.
ViewONE Standard
If you have downloaded ViewONE Standard (with or without the Print Accelerator or
Annotations optional modules), then to use ViewONE on your w eb site, se tup a w eb pa ge
containing the following HTML…
If you have downloaded ViewONE Pro (with or without the Print Accelerator, Annota tions,
DjVu, PDF or other optional modules), then to use View ONE Pro on your w eb site, setup a
web page containing the following HTML…
In each case, you must change the “codebase ” value to poin t to the loca tion of the ‘v1 files’
directory that contains ViewONEs resource files (i.e. ji.jar, ji.cab and other .v1 files).
The codebase parameter specifies the location of the ji .jar, ji.cab and o ther file s relative
to
the location o f the H TM L p age . So in th is cas e it speci fies the “c ur ren t d ir ect ory ” w hi ch i s
“.”
(Note: PARAM NAME=cabbase” is required for M icrosoft Explorer users) .
Our downloadable demos include examples to assist y ou.
Mayscript parameter
When using JavaScript it is important to include the M AYSCRIPT parameter (see both
HTML samples above). This parameter is an enabl er for the JavaScript interface. Without
it, calls to JavaScript will not work.
Apple Macintosh user s (Jav aScr ipt)
Depending on the version of the operating sy stem us ed by Apple M acintosh co mputers,
JavaScript may or may not operate correctly .
Apple MacOS 8 and 9 computers utiliz e Apples Java en gine known as M RJ (M acintosh
Runtime Java). This particular Java engine did not have full support for JavaS cript to Java
Applets and so the JavaScript API will not operate with M RJ.
Apple MacOS X (10.x) computers utilize Apples upd ated Java 2 engine w hich does
include support for JavaScript to Java API’s.
10
1010
10
Page 11
Apple Macintosh users (HTML)
ViewONE comes with a digital certificate which is required to permit the applet to print and
provide local caching. ViewONE is also Java 1.1.5 compliant.
Apple Macintosh 9 users will need to use IE4.5 (or l ater) and Apple M acintosh X (10.x ) can
use IE5, Netscape 7 or Mozi lla.
IE uses Apples run-time Java (called MRJ). Since the release o f IE4.5 Apple h ave
released several versions of MRJ. It is recommended that use rs use M RJ version 2.2 or
later. Netscape 7 and Mozilla browsers use Java 1.4 .x which is suppo rted by V iew ONE.
Using ViewONE Standard on IE for A pple Macintosh
To use IE (MRJ Java) you will hav e to ensure y our HTML speci fies the alternativ e archive
file…
ARCHIVE = “jis.jar”
Using ViewONE Pro on IE for A pple Macintosh
To use IE (MRJ Java) you will hav e to ensure y our HTML speci fies the alternativ e archive
file…
ARCHIVE = “ViewONEdsa.jar”
We have produced a demo w hich uses so me JavaScript to de tect Apple M ac users and
make appropriate changes automatically.
Demos are available at http://www.daeja.com/pub/start/downloads.html
11
1111
11
Page 12
Setting up Windows 2003 server
If your server is running Windows 2003 with IIS 6, you w ill hav e to add two file extensions
to your w eb site “M IME Types” .
Unlike previous Windows servers, Windows 2003 p ermits only a limi ted number of file
extensions by default, all others must be enabled ma nually using the IIS consol e.
The additional mime types required to operate ViewONE are “.v1” and “.ant”. Note: if they
are not added to IIS 6 then ViewONE will display messa ges during start-up that files w ith
these extensions could not be found).
Both file extensions should be set to the mime type “application/octet-stream”, as follows..
Open up IIS 6 console, then right-click on the top w eb space en try to highlight
“Properties”…
12
1212
12
Page 13
Click on the properties menu to display the properties dialog…
Click on the MIME Type button to display the M IM E Type dialog…
Use the New button to add two new M IM E types…
13
13
1313
Page 14
Click OK until you return back to the main console dialog. Ri ght click once a gain on the
main web spa c e e nt ry . Cl ick o n th e Re sta rt IIS me n u to ac ti v ate the n ew M IM E Ty pe s.
14
1414
14
Page 15
ViewONE JavaScript Ov erview
The ViewONE Javascript API offers an alternative mechanism to confi gure and control the
ViewONE applet.
In many cases the use of the Javasc ript API will not be required simply becaus e most
configuration parameters can be implemented using simple H TML (see ViewONE HTML
manual).
However, where a more dynamic operation is requir ed, for exam ple, where it i s desired to
configuration parameters during the operation of View ONE, perhaps to chan ge a
document without reloading a web page, rotate a page, inver t etc then the JavaScript API
is ideal.
Additionally, traditional web viewing applications habitually reload a web page in order to
view or change the currently view ed image/document.
But with ViewONE’s extensive Image/Document open/close JavaScrip t API methods it is
possible to avoid web page refreshing entirely. This can result in significant pe rformance
improvements since all delays due to web page reh freshing (and therefore Java En gine
reloading and applet restarting) are avoided.
Daeja has produced white paper specifically addres sing per formance tuning w hich covers
the area of web page refreshing and apple t reloading. Please v isit Daeja’s w eb site to
download white papers www.daeja.com
.
Browser Note :
Please note, some browsers are case sensitive and so we adv ise the use of method
names in exactly the same case as spe cified in this manual. Failure to adhere to this may
result in methods not being called correctly.
15
1515
15
Page 16
JavaScript Reference
The JavaScript examples in this manual do not refer to their use in any particul ar context.
The examples could be used within functions o f a Ja vaScript program o r directly as event
handlers to buttons, hyper-links etc. Our web site illustrates such u ses; al ternatively refer
to an appropriate JavaScript guide.
Filenames and hyperlink addresses are ex pressed using th e In ternet URL addr ess format
(Uniform Resource Locator), e.g. “http://mysite/myimage.tif”. If any part of the address
before “myimage.tif” is not included then the applet w ill assume a base addre ss that is the
same as the applet location (the codebase) .
With the exception of filenames and hyperlink addresses, all parameters a re case
insensitive.
Security note: Change sin ce Vie wONE 3. 0. 99 Standa rd and 1.0. 99 P ro
Some Javascript methods are disabled by default an d can only be enabled by setting the
JavaScripExtensions HTML parameter set to tru e .
<PARAM NAME=“JavaScriptExtensions” VALUE=“true”>
e.g.
This is to prevent unauthorized users from attempting to manipulate View ONE through
Javascript methods in or d er to obtain ac cess to sec ure
information/documents/annotations.
The methods that are restricted in this manner are clearly marked w ithin this document.
16
16
1616
Page 17
General Applet Control
Method:
isReady()
E.g. var ready = ViewONE.isReady();
This method returns true if the applet as completed initialization.
If JavaScript is used to open a documen t during HTM L page initialization then this method
is useful in determining when ViewONE has fully initialized (prior to opening the
document).
Browsers normally initialize Applets in parallel to HTML initialization and so it may be
necessary to use this method to synch ronize calls to View ONE. Also, ViewONE itsel f runs
thru an initialization phase in parallel to the loading of a web page.
Note on “object not found” message…
If you receive an “object not found” message while making this (or any JavaScript
calls) then it is because the applet has not been started by the browser (ViewONE
has not even had a chance to perform it’s own initialization). This message is
produced by the browser (not the applet).
The solution is to add some JS code to the call of isReady() which handles object not
found (or any use of JavaScript with ViewONE), as follows…
17
1717
17
Page 18
var appletReady = false;
var doc = parent.frames.main.document; //(or just 'document' if it's
not in a frame)
if (doc.ViewONE)
{
appletReady = doc.ViewONE.isReady();
}
if (appletReady)
{
//do something
}
Method:
The “if (doc.ViewONE)” line will result in false if the applet has yet to be started.
If you still have problems then you may want to make use of the “OnError” JavaScript
statement that allows you to set up your own error h andler. Your error handler w ill then be
called when a JavaScript problem is encountered s uch as abov e. E.g..
onerror = errorHandler;
//you code to do whatever you need to do… then…
function errorHandler()
{
//if we get here it is probably because a call has been made
//to the applet before the browser has had time to initialize it
//it can therefore be ignored
}
getVersion()
E.g. var version = ViewONE.getVersion();
Returns a String value representing the product version.
18
1818
18
Page 19
Opening documents and images
Method:
Method:
openFile(filename, page)
E.g. ViewONE.openFile(“myimages.tif”, 1);
Specifies the filename and initial page of the document to be view ed.
This filename can specify either the filename relative to the code base (as abo ve) or the
full URL. The code base is specified in the HTM L code for the applet (see previous
example). An example of a full URL is as follows…
E.g. ViewONE.openFile(“http://mysite/myimages.tif”, 1);
closeDocument()
E.g. ViewONE.closeDocument();
Closes an open document.
NOTE: Closing the open document also resets annotations, annotation templates and
E.g.
ViewONE.initializePageArray(3);
ViewONE.setPageArray(“page1.tif”, 0);
ViewONE.setPageArray(“page2.tif”, 1);
ViewONE.setPageArray(“page3.tif”, 2);
ViewONE.openPageArray(1);
This method group specifies the number files (pages) in a list, then specifies each file
(each one representing a successive pa ge of the do cument), then ope ns the ‘ assembled’
document at page 1. Note the page array begins at array element z ero.
19
19
1919
Page 20
Initializing the page and thumb arrays causes a ‘soft’ close to be pe rformed, i.e. the cu rrent
document is closed and the annotation source , templates and ba c kground images are
reset if a document is currently open. If no docu ment is cu rrently open, then the close and
reset is not performed.
E.g.
ViewONE.initializePageAndThumbsArray(3);
ViewONE.setPageArray(“page1.tif”, 0);
ViewONE.se tThu mbsA rra y (“p a ge1- t.ti f” , 0 );
ViewONE.setPageArray(“page2.tif”, 1);
ViewONE.se tThu mbsA rra y (“p a ge2- t.ti f” , 1 );
ViewONE.setPageArray(“page3.tif”, 2);
ViewONE.se tThu mbsA rra y (“p a ge3- t.ti f” , 2 );
ViewONE.openPageArray(1);
These methods are similar to the previous. They speci fy the number files (pages) in a list,
and then specify a separate file for each page and a thumbnail file for that page. The final
method then opens the “assembled” document at page 1 . Note, the pa ge array begins at
array element zero.
In some instances, it may be advantageous to have separate files for the thumbnails to
assist in browsing of thumbnails (smaller files are quicker to dow nload and v iew ).
Initializing the page anf thumb arrays causes a ‘soft’ close to be pe rformed, i.e. the cu rrent
document is closed and the annotation source , templates and ba c kground images are
reset if a document is currently open. If no docu ment is cu rrently open, then the close and
reset is not performed.
21
2121
21
Page 22
Method
Group:
initializeDocumentA rray(numDocs)
setDocumentArray( filenam e, index)
openDocumentArray()
E.g.
ViewONE.initializeDocumentArray(3);
ViewONE.setDocumentArray(“doc1parameters.txt”, 0);
ViewONE.setDocumentArray (“doc2parameters.txt”, 1);
ViewONE.setDocumentArray (“doc3parameters.txt”, 2);
ViewONE.openDocumentArray(1);
This method group specifies the number docu ments to open in a multi-docu ment session ,
then specifies the parameter file for each do cument ( each one representing a successiv e
document), then opens the ‘assembled’ document list at document t1 . Note the docu ment
array begins at array element zero.
For information about using document paramater files, please refer to the ViewONE HTML
Installation Manual; look up the section on the “Doc<N>” H TML parameter .
Method:
Initializing the page anf thumb arrays causes a ‘soft’ close to be pe rformed, i.e. the cu rrent
document is closed and the annotation source , templates and ba c kground images are
reset if a document is currently open. If no docu ment is cu rrently open, then the close and
reset is not performed.
openList(listFile, page)
E.g. ViewONE.openList(“mylist/list.txt”, 1);
This method offers and alternative option to the page array methods above. It allow s a file
to be supplied which contains a list of pa ges.
This is useful for very large documents becau se i t removes the need to deal w ith an a rray
in JavaScript .
It can also be used to keep the H TML cons tant, by changing the sour ce list instead o f
changing the HTML between different documen ts.
(Separate files for thumbnails are not available for this option).
22
2222
22
Page 23
Method:
Method:
Method
Group:
reloadList()
E.g. ViewONE.reloadList()
This method forces the list used with the openList() method to be reloaded an d the
document to be re-opened. It will reload the list file from source (i.e. the w eb s erver) each
time, so if it has changed then the changes w ill be picked up.
openDoc(index)
E.g. ViewONE.openDoc(2)
This method applies only when the “doc<N>” H TML paramete r is used ( see HTML
manual). The value of “index” represents the associ ated “doc<N>” parameter. Therefore,
the above example will cause ViewONE to open the secon d do cument in the list (i.e., that
specified by the “doc2” HTM L parameter).
These are convenience methods that can be used in place o f the “openDoc” method
described above.
getNumPages()
E.g. var numPages = ViewONE.getNumPages();
Gets the number of pages in the current d ocument ( an integer).
23
23
2323
Page 24
Method:
Method:
Method:
setPage(page)
E.g. View ON E.se tP a ge( 2) ;
Sets the current page number (an integer).
getPage()
E.g. var page = ViewONE.getPage();
Returns the current page number as an inte ger.
nextPage()
E.g. ViewONE.nextPage();
Method:
Method
Group:
Convenience method to view the next page (c urrent page + 1 )
previousPage()
E.g. ViewONE.previousPage();
Convenience method to view the previous pa ge (current page - 1).
setDescription(description)
getDescription()
E.g.
var desc = ViewONE.getDescription();
ViewONE.setD esc ri ptio n(“ my Do c”);
Gets or sets the description for the document. The d escription is used w hen opening the
document in ViewONE, “Opening docXYZ…” or “Opening docXYZ, page 2….” will be
displayed in the status bar.
24
2424
24
Page 25
Method:
Method:
getDocReference()
E.g.
Var ref = ViewONE.getDocReference();
Gets the document reference for the document.
getCacheFile()
E.g. var file = ViewONE.getGetCacheFile();
Returns a String value representing the local filename of the displayed image.
If the file was loaded locally then this value will be the actual local image file. If the file w as
loaded from a web server then this value w ill be the local ‘cached’ v ersion of the image file.
*Important: This file must not be locked during read operations (or deleted, renamed.
moved etc), as the applet will not be able to con tinue to use it and unp redictable results
may occur.
isCacheAccessFailed
()
Returns true i f access to the Vi ewON E cache fails. Vie wON E may atte mpt to write to more
than one location before and will only return true from this call if all attempts to w rite have
failed.
25
2525
25
Page 26
Specifying an A nnot ations File
Method:
setAnnotationFile(filename)
E.g. ViewONE.setAnnotationFile(“http://mysite/myannotations.ant”);
This method sets the annotation file and must be ca lled be fore
any of the open methods
described above.
If the current document is closed after this method has been called, the anno tation file will
be reset. To avoid this, close the current document be fore setting the annotation file, as
closing of the current document can be a side effect o f calling other JavaScrip t methods,
for example, ‘initializePageArray’.
e.g.
viewONE.setAnnotationFile("http://...annotations.ant");
viewONE.openFile(“http://... m ydocument.t if” , 1);
E.g. View ON E.sa ve (“ c:/ te mp/i ma ge .ti f” );
Saves the cu rre n t d ocu me nt ( mul ti-pa g e ti ffs ), o r c u rr en t pa ge ( mul ti- fi le d o cum ents ) to the
specified filename.
If filename is null, either the save dialog is displayed or, if a server side save co mponent
has been specified, the image is sent to the serv er side componen t.
Note: The save operation does not recreate the source file, it merely copies the sou rce file
to the specified destination and renames it to the sp ecified filename.
savePage(filename)
E.g. ViewONE.savePage(“c:/temp/page.tif”);
Saves the current page to the speci fied filename.
Method:
If filename is null, either the save dialog is displayed or, if a server side save co mponent
has been specified, the image is sent to the serv er side componen t.
If the document is a multi-page tif then this method will extract the current page from the
source tif file, and create a new tif file containing only the cu rrent page.
saveSelected(filenam e)
E.g. View ON E.sav e Sel ect ed (“c: /te mp /sel ec ted .tif”);
Saves the current selected pages of a multi-page tif document.
If filename is null, either the save dialog is displayed or, if a server side save co mponent
has been specified, the image is sent to the serv er side componen t.
Note: this method is for use only with multi-page tif documents. If you are v iewing a multi-
file document then it is not possible to save selected pages from that docu ment ex cept by
individually calling the savePage() method for each page that you w ant to sav e. You may
find isMultipageTif() and getSelected() methods useful to call before calling this method.
27
2727
27
Page 28
Method:
isMultipageTif()
E.g. vat ismulti = ViewONE.isMultipageTif();
This method is useful if you want to first check w hether the cu rrent documen t is a mul ti-
page tif before using the above methods.If it is then this method returns true else it r eturns
false.
28
2828
28
Page 29
Document hyperlinks
Method:
Method:
setHyperlink(url, dblCl ick)
E.g. ViewONE.setHyperlink(“newpage.html”, false);
or
ViewONE.setHyperlink(“http://mysite/newpage.html”, false);
Specifies a hyperlink that is activated when the use r clicks on the i mage area. If the
dblClick parameter is ‘true’ then the hyperlink is activated only after the user double-clicks
on the image area, otherwise it requires only a single click.
The hyperlink can specify either the filename relative to the code base or the full URL as
illustrated.
clearHyperlink()
E.g. ViewONE.clearHyperlink();
This method clears a hyperlink if one has p reviously been de fined usin g the se tHyperlink()
method.
29
2929
29
Page 30
PDF Viewing Options (Pro-Only)
ViewONE Pro introduced an optional PDF module. The module comes w ith v arious
optional methods as follow s...
Method:
(Pro-Only)
Method:
(Pro-Only)
setPDFPixelDepth(pixeldepth)
E.g. ViewONE.setPDFPixelDepth(8);
This method will change the default pixel depth when viewing PDF documen ts. The pixel
depth dictates the number of colors that are used for v iewing as follow s:
PixelDepth
1: View in Monochrome format (black and white)
8: View in Grayscale (256 grays)
24: View in full color (4.2 million colors).
For higher performance (but less colors) choose 1 or 8, for all colors (but slower
performance) choose 24. The default value is 8.
getPDFPixelDepth()
E.g. var depth = ViewONE.getPDFPixelDepth();
Returns the current pixel depth used w hen view ing PDF documen ts.
Method:
(Pro-Only)
setPDFResolution(resolution)
E.g. ViewONE.setPDFResolution(200);
This method will change the default resolution when viewing PDF docu ments. The
minimum value is 50 and maximum is 1200.
For higher performance will result when using lower resolutions but less quality
(depending on the PDF document), and low er performance but hi gher quality for hi gher
resolutions.
30
30
3030
Page 31
Method:
(Pro-Only)
Method:
(Pro-Only)
getPDFResolution()
E.g. var d ep th = V i ew ON E. getP DF Re so lu tio n ();
Returns the current resolution used when view ing PDF documents .
setAutoLimitPDFReso lution( true/fal se)
E.g. ViewONE.setAutoLimitPDFResolution(true);
When the p a ram ete r is se t to true , Vi ew ON E w i ll d y nami call y li mit the P DF res ol uti on i n
order to obtain maximum performance when vi ewing PDF documents.
ViewONE will attempt to use the default PDF resolution (see above) but if that resolution is
likely to result in slow performance, ViewONE will reduce the resolution on a p er document
and page basis depending on the setAutoLimi tPDFMemoryValue() method d escribed
below.
Method:
(Pro-Only)
Method:
(Pro-Only)
isAutoLimitPDFResolution()
E.g. var limited = ViewONE.isAutoLimitPDFResolution();
Returns tru e to i ndi cate l imi tin g i s sw itch o n a nd fal s e i f no t.
setAutoLimitPDFMem ory Value(v alue)
E.g. ViewONE.setAutoLimitPDFMemoryValue(10000000);
This methods controls the way ViewONE limits resolution when usin g the limiter de scribed
above.
The parameter dictates the maximum amount of memory that is pe rmitted for a
decompressed PDF page. If a page exceeds this amount (e.g. w hen using hi gh de fault
PDF resolutions) then ViewONE will use a resolution for that page that brin gs it under this
memory limit. The actual resolution used will depend on the pa ge dimensions and colo r
depth. To discover the limited resolution a page must first be vi ewed, then y ou can display
the Image Information dialog (see Image Information button).
The default value for this parameter is 5Mb (5 * 1024 * 1024 = 5242880 by tes).
If you find the limited resolution is resulting in degraded viewing quality, but y ou also wish
to keep using the auto limiter, then try increasing the default value usin g this paramater.
31
31
3131
Page 32
The best value for you can only really be dis covered by experimentation sinc e it depends
upon your documents, PC and networ k performance and user p references.
Method:
(Pro-Only)
getAutoLimitPDFMemoryValue()
E.g. var li mi t = V ie w ONE .ge tAut oL imi tPD FM e mo ry Va lue () ;
Returns the current limiting value used when viewing PDF docum ents.
32
3232
32
Page 33
COLD Viewing Options (Pro-Only)
ViewONE Pro introduced an optional COLD module.
The COLD module is responsible for implementing image merging and text formatting
processes.
A COLD document (Computer Output to Laser Disk) is traditionally a docume nt that has
both text and image content and is usually used w ith forms packages.
During COLD forms’ input, the fields are separated from the actual fo rm (also k now n as
the background or template) and during view ing they need reconstitutin g so tha t the use r
sees the complete for m with co mple ted fiel ds.
The ViewONE COLD module allows any of its suppo rt files formats to be used either as a
background template or foreground content.
For example, it is possible to have a TIFF or JPEG i mage as the backgro und template and
simple text as the foreground.
The COLD module is particularly effective when combined with the PDF mo dule. It then
becomes possible to have PDF used as ei ther or b oth background and foreground.
Although more commonly one would use an i mage (t ypically TIFF based) as the
background (thereby getting best performance and compression) and u tilize the adv anced
text PDF formatting to handle the foreground (thereby able to c reate advanced forms for
display).
Note: There are many proprietary COLD document formats in circulation. Daeja will look at
any sample (with specifications) that you provide to a ssess the feasibility of adding speci fic
format support to ViewONE. Currently the COLD module supports simple ASCII text and
PDF document types.
The module comes wi th v ari ous opti onal para me ter s as foll ow s...
33
3333
33
Page 34
Method:
(Pro-Only)
Method
Group:
(Pro-Only)
setBackgroundImage(filename, pageNumb er)
E.g. ViewONE.setBackgroundImage(“mybackimage.tif“, 1);
This method is used to set the COLD background template for all pa ges in a d ocument.
The pageNumber paramater is used where the file used for the bac kround sup ports
multiple pages, such as TIF and PDF files.
Note: this method must be called before opening a document .
This method group is used to specify a di fferent COLD background template file for each
page. If this technique is used then a template must be spe ci fied for all pages of your
document.
The first methods specifies the number files (pages) in a list, followed by a series of
methods that specify each template (each one representing a successiv e page o f the
document), the final method informs ViewONE that the templates are de fined and r eady to
use.
Note: these methods must be called before ope ning a docu ment.
34
3434
34
Page 35
Method:
(Pro-Only)
Method:
(Pro-Only)
setBackgroundImageEnabled(true/false)
E.g. ViewONE.setBackgroundImageEnabled(false);
This method is used to change the visibility of the COLD template image. A v alue of false
will remove the template from view, and a value of true will show the template.
isBackgroundImageEnabled()
E.g. var inverted = ViewONE.isBackgroundImageEnabled();
Returns a Boolean ‘True’ if the COLD template is visible
Example JavaScript fo r opening a do cument with background tem plates
viewONE.setAnnotationFile("http://...annotations.ant");
viewONE.openPageArray(1); //open at page 1
35
3535
35
Page 36
Document Indexes (Pro-Only)
ViewONE Version 3 introduced an option to specify a text index for multi-page documents.
A text index acts as an alternative to the thumbnail pane and w ith large docu ments can
offer better performance than thumbnails (due to not hav ing to handle i mage
decompression display).
ViewONE offers a default text index which displays page nu mbers; howev er the list may
be customized using the following method.
Method:
(Pro-only)
setIndexListFile(URL)
E.g. View ON E.se tIn d ex Li stF il e( “ht tp :// my si te/ my li st. tx t“) ;
The file specified must be a simple text file, with <LF> delimiting successive page indexes.
36
3636
36
Page 37
Image
Method:
Method:
(V3-Only)
invert()
E.g. ViewONE.invert();
Inverts the display colors (black changes to white and visa-versa). This method is also
effective on images with more than two colors. A second call to this method will reestablish the original display colors.
If the document is closed when this method is called, the default for all pages is modified. If
the document is open when this method is called, the individual page is modified only.
setInverted(true/fal se)
E.g. View ON E.se tIn v er ted (t rue) ;
Sets the invert of the display colors (black changes to white and visa-versa). This method
is also effe c tiv e on i ma ges w ith mo re tha n tw o co lo rs
If the document is closed when this method is called, the default for all pages is modified. If
the document is open when this method is called, the individual page is modified only.
Method:
Method:
isInverted()
E.g. var inverted = ViewONE.isInverted();
Returns a Boolean ‘True’ if the colors are inverted, ‘False’ i f they are not.
setEnhance(true/fal se)
E.g. var ViewONE.setEnhance(true);
Specifies whether a monochrome image is displayed with anti-aliasing on or off. A value of
‘true’(default) is on and ‘false’(default) is off.
37
37
3737
Page 38
Method:
Method:
isEnhance(true/false)
E.g. var enhance = ViewONE.isEnhance();
Returns a Boolean ‘True’ if enhance is on, ‘False’ if it is of f.
setEnhanceMode(mode)
E.g. ViewONE.setEnhanceMode(1);
Specifies which anti-aliasing algorithm to use…
0: Off (all image formats)
1: Weighted averaging (monochrome), averaging (24 bit color)
2: Averaging (monochrome), averaging (24 bit color)
3: Scale-to-black (monochrome), averaging (24 bit color)
Note: This method can be used to turn on/o ff Anti-Aliasing and so there is no n eed to use
both this and setEnhance methods together.
Method:
(V3-Only)
Method:
getEnhanceMode()
E.g. var state = ViewONE.getEnhanceMode();
Returns the current enhance state.
setRotation(angle)
E.g. ViewONE.setRotation(90);
Specifies the angle at which pages are displayed. Values of 90, 180, or 270 are accepted.
The default is 0.
If the document is closed when this method is called, the default for all pages is modified. If
the document is open when this method is called, the individual page is modified only.
38
38
3838
Page 39
Method:
Method:
initializeRotationArray(int size)
E.g. ViewONE.initializeRotationArray(4);
Initializes the rotation array, used for setting the rotation of each page of the current image,
to the give n size .
setRotationArray(int angle, int page)
E.g. var ok = ViewONE.setRotationArray(90, 0);
Sets the rotation for given page to the given ang le. The pages are indexed from 0, so t he
first page is zero, the second is 1 etc.
The specified angle should be one of 0, 90, 180 or 2 70.
The JavaScript method initializeRotationArray should be used to set the size of the rotation
array before this method is called.
Method:
Method:
The method returns true if the page rotation was successfully set or false if the set failed,
for instance if the specified page is an invalid index in the rotation array initialized using
initializeRotationArray.
applyRotationArray()
E.g. ViewONE.applyRotationArray();
Applies the rotation array set up using the initializeRotationArray and setRotationArray
methods to the current image.
getRotation()
E.g. var angle = ViewONE.getRotation();
Returns the a n gle o f rotation a s an i nte ge r.
39
39
3939
Page 40
Method:
Method:
rotateClockwise()
E.g. View ON E.ro ta te Cl oc kw ise ();
Convenience method to increase the rotation by 90 degrees.
If the document is closed when this method is called, the default for all pages is modified. If
the document is open when this method is called, the individual page is modified only.
rotateCounterclockwise()
E.g. View ON E.ro ta te Co un ter cl oc kw ise ();
Convenience method to decrease the rotation by 90 degrees .
If the document is closed when this method is called, the default for all pages is modified. If
the document is open when this method is called, the individual page is modified only.
Method:
Method:
rotate180()
E.g. ViewONE.rotate180();
Convenience method to rotate the document to 180 de grees.
If the document is closed when this method is called, the default for all pages is modified. If
the document is open when this method is called, the individual page is modified only.
setFlip(mode)
E.g. ViewONE.setFlip(1);
Specifies the flip mode of displayed pages. Values of 0 (none), 1 (horizontal or mirror), 2
(vertical) or 3 (both) are accepted. The de fault is 0.
Flip buttons and menus are not visible to the user by default. To enable these options for
the user you must use the flipOptions HTM L tag w hen the applet is loaded .
If the document is closed when this method is called, the default for all pages is modified. If
the document is open when this method is called, the individual page is modified only.
40
40
4040
Page 41
Method:
Method:
getFlip()
E.g. var angle = ViewONE.getFlip();
Returns the flip mod e as an inte ger .
setScale(scal e)
E.g. ViewONE.setScale(0);
Specifies the scale mode used to display a pa ge. Acceptable integer values ar e:
0: best fit
The page is scaled to fit into the w indow area so that the en tire page is v isible.
1: Fit-to-window-width
The page is scaled so that the width of the page matches the width of the window
area. This may result in the visible page height exceeding the available window
height in which case a vertical scroll bar appears automatically
.
Method:
Method:
2: Fit-to-window-height
The page is scaled so that the height of the page matches the height of the
window area. This may result in the visible page width exceeding the available
window width in which case a horizontal scroll bar appears
getScale()
E.g. var scale = ViewONE.getScale();
Returns the integer scale value.
getStates()
E.g. stat e s = V i ew ON E .ge tS ta te s ();
Returns a coded string to be used with setStates(). When this method is called while a
document it open, it returns a string containing information about the current zoom, scroll
and other states.
41
4141
41
Page 42
Method:
Method:
Method:
setStates(string st at es)
E.g. View ON E.se tS ta tes (s ta te s) ;
Sets the zoom, scroll and other states to the values specified by the coded string. This
method should be called before opening a docu ment.
The getStates() and setStates() methods together permit the viewing states to be restored
when a document is closed and re-opened .
zoomIn()
E.g. ViewONE.zoomIn();
Applies a 25% increase in zoom. Note, at first ViewONE will attempt to use the scale
modes (fit-to-width, fit-to-height and best-fit) if they are more appropriate. The zoomIn()
function will increase the zoom factor only after the scale modes are no longer suitable.
zoomOut()
E.g. ViewONE.zoomOut();
Reverses the effec t of z oomIn ().
Method:
zoom100()
E.g. ViewONE.zoom100();
Zooms image to 100% (full resolution).
42
4242
42
Page 43
Method:
setZoom(zoom)
E.g. View ON E.se tZ oo m(2 .0 );
Zooms to the value specified. The value is speci fied as a double value - 1.0 = 100% or 1
image pixel = 1 screen pixel, 2.0 = 200% o r 1 i mage pix el = 2 scr een pixels.
If used in conjunction with setXYScroll, it is advisable to use se tZoomAndXYScroll instead
as problems may occur when both setZ oom and se tXYScroll are used together.
Method:
Method:
setZoomAndXYScroll(zoom, x, y)
E.g. ViewONE.setZoomAndXYScroll(2.0, 100, 100);
Zooms to the value specified. The value is speci fied as a double value - 1.0 = 100% or 1
image pixel = 1 screen pixel, 2.0 = 200% o r 1 i mage pix el = 2 scr een pixels
zoomArea(x, y, width, height, highlight, seconds)
E.g. ViewONE.zoomArea(400, 500, 100, 150, true, 2);
Zooms to an area starting at “x”, “y” which is “width” across and “height” high. If “highlight”
is set “true” then the area z oomed is also hi ghlighted for a time sp eci fied by the “seconds ”
parameter.
If “seconds” is greater than 0 then the highlight is visible for that time. If “seconds” is less
than or equal to 0 then the highlight will remain visible until the user clic ks or forces a
refresh by scrolling, rotating, etc.
If the area specified is a different aspect ratio from the display area then the view er w ill
attempt to fi t the z oom as best it can.
setXYScroll(x, y)
E.g. ViewONE.setXYScroll(20,20);
Sets the scroll bar positions to the given values in screen pix els.
If used in conjunction with setXYScroll, it is advisable to use se tZoomAndXYScroll instead
as problems may occur when both setZ oom and se tXYScroll are used together.
43
43
4343
Page 44
Method:
Method:
Method:
setDraggingEnabled(t rue/false)
E.g. ViewONE.setDraggingEnabled(true);
Specifies whether the dragging of the ima ge is per mitted or not (using the mouse).
Dragging the image to the right pans the image to the right, dragging the image to the left
pans the image to the left etc.
A value of ‘true’ (default) indicates dra gging is permitted and ‘false’ indicates that i t is not
isDraggingEnabled()
E.g. var draggingEnabled = ViewONE.isDraggingEnabled();
Returns a Boolean value of ‘true’ if dragging is allowed else a value ‘ false’ is returned.
setBrightness(percent)
E.g. ViewONE.setBrighness(60);
This method sets the brightness of the display ed. T he value rep resents a per centage from
0-100, with 50 being the default value. 0 = minimum brightness (dar k) and 100 =
maximum bri ghtne ss (li ght ).
Method:
If the document is closed when this method is called , the default for all pa ges is modified. If
the document is open when this method is called, the individual page is modified only.
resetBrightness()
E.g. ViewONE.resetBrighness();
This method resets the brightness level to 50% (the default value).
If the document is closed when this method is called , the default for all pa ges is modified. If
the document is open when this method is called, the individual page is modified only.
44
44
4444
Page 45
Method:
getBrightness()
E.g. var percent = ViewONE.getBrighness();
Returns the current brightness percentage setting (0-100).
Method:
Method:
setContrast(percent)
E.g. View ON E.se tC on tra st(4 0 );
This method sets the contrast of the image displayed. The value represents a percentage
from 0-100, with 50 being the default value. 0 = mini mum contrast (flat) and 100 =
maximum brightness (not flat!).
If the document is closed when this method is called , the default for all pa ges is modified. If
the document is open when this method is called, the individual page is modified only.
resetContrast()
E.g. View ON E.re se tCo n tr as t ( );
This method resets the contrast level to 50% (the default value).
If the document is closed when this method is called , the default for all pa ges is modified. If
the document is open when this method is called, the individual page is modified only.
Method:
getContrast()
E.g. var p e rce nt = Vi ew ON E. ge tCo n tra st ();
Returns the current contrast percentage setting (0-1 00).
45
45
4545
Page 46
Method:
Method:
setLuminance(percent)
E.g. View ON E.se tLu mi na nce (70 );
This method sets the luminance of the ima ge displayed. The v alue represents a
percentage from 0-100, with 50 being the defaul t value. 0 = minimum luminance (dull) and
100 = maximum brightness (bright).
If the document is closed when this method is called , the default for all pa ges is modified. If
the document is open when this method is called, the individual page is modified only.
Brightness increases the brightness of all colors (dark and li ght) uniformly, w hereas
luminance causes already bright areas of the image to increase in brightness further and
darker areas to increase in brightness also, but by a lesse r amount. This si mulates a light
source shining on the image and can be more e ffective at making color images clea rer to
read.
resetLuminance()
E.g. ViewONE.resetLuminance();
This method resets the luminance level to 50% (the de fault value).
Method:
Method:
Method:
If the document is closed when this method is called , the default for all pa ges is modified. If
the document is open when this method is called, the individual page is modified only.
getLuminance()
E.g. var percent = ViewONE.getLuminance();
Returns the cu rren t lu man ce p e rcen ta ge se ttin g (0 -1 00).
getImageWidth()
E.g. var width = Vi ewONE.get I ma geWidth();
Returns an integer value representing the width of the cu rrently displayed image in i mage
pixels.
46
4646
46
Page 47
getImageHeight()
E.g. var height = ViewONE.getImageHeight();
Returns an integer value representing the height of the currently displayed ima ge in ima ge
pixels.
Method:
Method:
getXResolution()
E.g. var x R es = Vi ew ON E .ge tXR e sol uti on () ;
Returns an integer value representing the x-axis resolution of the currently dis played
image in dots per inch.
The value is obtained from the image’s header information, so if the information is missing
or corrupt the returned value will make no sense.
getYResolution()
E.g. var y R es = Vi ew ON E. getY R e sol uti on () ;
Returns an integer value representing the y-axis resolution of the currently dis played
image in dots per image.
The value is obtained from the image’s header information, so if the information is missing
or corrupt the returned value will make no sense.
47
4747
47
Page 48
Viewing
Method:
setView(view)
E.g. ViewONE.setView(0);
Specifies the view mode used to display pa ges of a document. This method is e ffective
only while a document is open. Acceptable integer v alues are:
0: Fullpage
(default): A single view of the current page is visible
1: Twopage
Two pages are visible at the same time
2: Thumbsonly
A view of the thumbnails only is visible.
3: Thumbsleft
A view o f th e cu rre nt pa ge with thum bna il s on th e le ft of the pa ge .
4: Thumbsright
A view o f th e cu rre nt pa ge with thumb na il s on th e ri gh t o f th e pa ge .
5: Thumbstop
A view of the current page with thumbnails at the top of the page.
6: Thumbsbottom
A view of the current page with thumbnails at the bottom of the pa ge.
Method:
getView()
E.g. var scale = ViewONE.getView();
Returns the i nte ger view mo de v al ue .
48
4848
48
Page 49
Method:
Method:
setAreaZoom(true/false)
E.g. View ON E.se tA rea Z o om (tru e );
If true, initiates the zoom-area mode. The mouse pointer changes to a cross and the u ser
can drag the mouse (using button one ) to selec t an area for zoo ming. When the mouse
button is released the area selected will be zoomed as large as po ssible whilst maintaining
the image aspect within the available window area.
If the selected area is not greater than the z oom trigger size (currently 20*20 pix els) then
zooming will not occur. This allows the user to release the mouse i f the mode was initia ted
accidentally.
If false, mouse functionality returns to drag mode (to pan the image).
isAreaZoom()
E.g. var areaZoom = ViewONE.isAreaZoom();
Returns a Boolean value indicating the zoom-area status.
Method:
(V3-Only)
Method:
toggleAreaZoom()
E.g. ViewONE.toggleAreaZoom();
This toggles ViewONE zoom area mode. When in zoom area mode the cursor w ill change
to a cross hair and the user can select an area to zoom using the cu rsor. When not in
zoom area mode, the cursor can be us ed to drag/scroll the image.
setMagnifier(true/false)
E.g. ViewONE.setMagnifier(true);
If true, displays an external magnifier window. A rectangle is visible around the mouse
pointer which highlights the area being magnified.
If false, the magnifier window is hidden.
49
4949
49
Page 50
Method:
setMagnifierInternal(tr ue/false)
E.g. ViewONE.setMagnifierInternal(true);
If true, displays a magnifier window internal to the display area.
If false, the magnifier window is hidden.
Internal…
External…
50
5050
50
Page 51
Method:
Method:
(V3-Only)
Method:
isMagnifier()
E.g. var magVisible = ViewONE.isMagnifier();
Returns a Boolean value indicating the magnifier visibility status.
toggleMagnifier()
E.g. ViewONE.toggleMagnifier();
Toggles th e ma gni fie r on /o ff.
setMagFactor()
E.g. ViewONE.setMagFactor(int factor);
Sets the current integer magnification factor (for magnifier window)
Method:
Method:
Method:
getMagFactor()
E.g. var fac tor = Vi ew ONE .getM agF acto r() ;
Returns the current integer magnification factor (for magnifier window)
setMagBounds(int x, int y, int width, int height)
E.g. ViewONE.setMagBounds(10, 10, 300, 300);
Sets the external magnifier’s window position and si ze.
setNewWindowVisible(true/false)
E.g. ViewONE.setNewWindowVisible(true);
Specifies whether to make the ViewONE new w indow visible. A value o f ‘true’ makes the
window visible and ‘false’ (default) makes it invisible.
51
5151
51
Page 52
Method:
Method:
(V3-Only)
Method:
(V3-Only)
isNewWindowVisible()
E.g. ViewONE.setNewWindowVisible(!ViewONE.isNewWindowVisible());
Returns a Boolean value of ‘true’ if the View ONE new window is v isible else a v alue ‘false’
is returned.
setImageForeColor(color)
E.g. ViewONE.setI ma geF o reCo lo r (0, 0 , 0 )
This method sets the default color used for the foreground (text) o f monochrome ima ges.
Colors are specified using the standard RGB values.
showImageForeColorDialog()
E.g. ViewONE.showImageForeColorDialog();
This method will cause ViewONE to display a dialog to allow the user to change th e
default color used for the foreground (text) of monochrome images.
52
5252
52
Page 53
Method:
(V3-Only)
Method:
(V3-Only)
setImageBackColor(c olor)
E.g. ViewONE.setImageBackColor(255, 255, 255)
This method sets the default color used for the back ground o f monochrome im ages.
Colors are specified using the standard RGB values.
showImageBackColorD ialog()
E.g. ViewONE.showImageBackColorDialog();
This method will cause ViewONE to display a dialog to allow the user to change th e
default color used for the background of monochrome images.
E.g.
ViewONE.initializeLabels(3);
ViewONE.setLabel(“Page label 1”, null, “thumb 1”, null, 0);
ViewONE.setLabel(“Page label 2”, null, “thumb 2”, null, 1);
ViewONE.setLabel(“Page label 3”, “223,223,255”, “thumb 3”, “255,223,223”, 2);
ViewONE.useLabels();
ViewONE.openFile(“mydocument.tif”, 1);
This method group specifies the number files (labels) in a lis t, then speci fies each label.
Each one representing a successive pa ge of the documen t and speci fying the label to be
displayed for the full-page area and the corresponding thumbnail. It then sets the labels in
use by calling the useLabels() method.
Label colors are specified using the standard RGB values and w here no colo r is speci fied
(i.e. null) then the default color is white.
Notes:
The label array begins at array element zero.
Labels will remain visible until the document is closed or the clearLabels() method is
called.
If you do not want to define a label for either the full-page a rea or a thumbnail then spe cify
the label as a null string e.g…
ViewONE.setLabel(null, null, “thumb 1”, null, 0);
This example sets up a label for the thumbnail for the first page.
54
54
5454
Page 55
Selection and clipboard
Method:
Method:
Method:
selectPage(int pageN umber)
E.g. ViewONE.selectPage(4);
Toggles the select property on the page in a docu ment indicated by the “pageNumber”
parameter (available for multi-page documents only).
clearSelections()
E.g. ViewONE.clearSelections();
Clears all page selections in the document (available for multi-page documen ts only).
copyPageToClipboard()
E.g. ViewONE.copyPageToClipboard();
Method:
Produces a print dialog to allow the user to print the current page.
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
getSelection()
E.g. selection = ViewONE.getSelection();
This method returns a comma-delimited string containing any pages selec ted by the use r.
55
55
5555
Page 56
Printing
Method:
Method:
printPage()
E.g. ViewONE.printPage();
Produces a print dialog to allow the user to print the current page.
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
printDocument()
E.g. ViewONE.printDocument();
Produces a print dialog to allow the user to print the current document (available for multi-
page documents only).
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
Method:
Method:
printRange()
E.g. Vie w ON E.p rin tR a n ge ();
Produces a range dialog followed by a print dialog to allow the user to print a range o f
pages in a document (available for multi-page documents only).
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
56
5656
56
Page 57
printSelected()
E.g. ViewONE.printSelected();
Produces a print dialog to print pages selected using the page-select menu (available for
multi-page documents only). Can be used with the “selectPage(pageNumber)” and
“clearSelections()” methods to print any page or group of pages w ithin a docu ment.
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
Method:
Method:
printVisible()
E.g. ViewONE.printVisible();
Produces a print dialog to print the image display (visible).
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
printTransformed()
E.g. ViewONE.printTransformed();
Generates a print with rotate, invert and flip modes applied to the image.
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
Method:
setPrintDialog(true/fal se)
E.g. ViewONE.setP rin tD ia lo g(fa ls e );
This method applies only when the print-accelerator is used. When this parameter is set to
false, printing will take place without showing the standard print-dialog. If the user has not
printed using ViewONE with the accelerator previously, then the users’ default printer will
be used. Otherwise, the last printer used by the user (with ViewONE print acce lerator) will
be used.
57
57
5757
Page 58
Method:
Method:
Method:
isPrintDialog()
E.g. var dialog = ViewONE.isPrintDialog();
Returns a Boolean ‘True’ if the print dialog is enabled, ‘False’ i f it is not.
setPrintCopies(integer)
E.g. ViewONE.setPrintCopies(2);
This method is effective only when the print dialog is disabled (by calling
setPrintDialog(false) or using the equivalent HTML tag). This method sets the number o f
copies that will be printed when printing a page, pa ges o r the documen t.
setPrinter(string)
E.g. View ONE .se tPri n ter(“ my pri nte r” );
This method is effective only when the print dialog is disabled (by calling
setPrintDialog(false) or using the equivalent HTML tag). This method sets the V iewONE
default printer to the one specified as the parameter. The parameter must b e the ‘name’
(or unique part thereof) as seen by the users printer settings. The printers’ default settings
will be used for each print (e.g. orientation, resolution etc).
58
5858
58
Page 59
Method:
setPrintHeader(head erSt ring)
E.g. ViewONE.setPrintHeader(“$page # $of ##”)
Printouts can include custom text at the top o f each page. By de fault this text i s set to the
page number followed by the number of pa ges in the docu ment. The following options are
available…
“false” : This value will disable print headers
“any text” : This is the text that will appear at the top of each p rinted page. For
example, it could be your own copy right for the docu ments bein g view ed
or some othe r i n for ma tio na l te xt .
“formatted tex t ” : The tex t ca n i nclu de so m e l imi ted for ma tte d el e me nts as foll ow s:
$page : This will print the word “page” in the appropriate translation
$of : Similarly for the word “o f”
$pages: Similarly for the word “pages”
# : This will print the page number of the page being printed
## : This will print the number of pages in the document
An example…
“$page # $of ##
Copy right blah 2000”
Note 1: The default value is: “($page # $of ##)”
Note 2: Print headers are available for Internet Explorer 4.01+, Netscape 4.06+ and the
Java Plugin 1.3 (The Java Plugin 1.2.2 does not offer sufficient functionality to permit print
headers and so they will not be se en if u sing this version o f the plu gin).
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
59
5959
59
Page 60
Method:
setPrintAutoRot ate (t rue/false)
E.g. ViewONE.setPrintAutoRotate(true)
This parameter is only available when used with the print accelerator and only applicable
when the tag multiPrintNum is set to more than 1.
If this parameter is set to true, then ViewONE will attempt to rotate images automatically
prior to printing so that as many images can be p rinted (vertically) on a p rinted page as
possible. The default value for this tag is false.
60
6060
60
Page 61
Toolbars and Buttons
Method:
Method:
Method:
setScrollbars(true/f als e)
E.g. ViewONE.setScrollbars(true);
Specifies whether scrollbars will appear when the image is scaled to a siz e larger than the
display area. A value of ‘true’ (default) indicates scrollbars are required and ‘ false’
indicates they are not. A change in this setting will be visible after the next refresh o f the
display (e.g. when a page is zoomed or unz oomed o r a page is chan ged etc.).
isScrollbars()
E.g. var scrollbars = ViewONE.isScrollbars();
Returns a Boolean value of ‘true’ if scrollbars a re enabled else a value ‘ false’ is r eturned.
setStatusBar(true/f als e)
E.g. View ON E.se tS ta tusB ar( tru e) ;
Specifies whether the statusbar is visible or not. A v alue of ‘true’ (default) indicates the
statusbar is visible and ‘false’ indicates that it is no t.
Method:
isStatusBar()
E.g. var statusBarVisible = ViewONE.isStatusBar();
Returns a Boolean value of ‘true’ if the s tatusbar is visible else a v alue ‘ false’ is returned.
61
61
6161
Page 62
Method:
Method:
setFileButtons(true/false)
E.g. ViewONE.setFileButtons(true);
Specifies whether the toolbar includes file buttons. A value o f ‘true’ (de fault) indicates the
buttons are visible and ‘false’ indicates they are not.
The file buttons are:
Open, Close , S av e.
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
isFileButtons()
E.g. var buttonsVisible = ViewONE.isFileButtons();
Returns a Boolean value of ‘true’ if the file buttons a re visible else a v alue ‘ false’ is
returned.
62
6262
62
Page 63
Method:
Method:
setImageButtons(true/f alse)
E.g. ViewONE.setI ma geB u tto ns( tr ue );
Specifies whether the toolbar includes image buttons. A value of ‘true’ (default) indicates
the buttons are visible and ‘false’ indicates they are n ot.
The image buttons are:
Zoom area , Z oo m in , Z o o m o ut , Fi t to w i dth , Fi t to h ei ght, Be s t fi t, R ota te cl oc kw ise , Ro ta te
counterclockwise, Rotate 180.
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
isImageButtons()
E.g. var buttonsVisible = ViewONE.isImageButtons();
Returns a Boolean value of ‘true’ if the i mage buttons are vi sible else a v alue ‘false’ is
returned.
Method:
setPrintButtons(true/false)
E.g. ViewONE.setPrintButtons(true);
Specifies whether the toolbar includes a print button. A value of ‘true’ (default) indicates
the button is visible and ‘false’ indicates it is not.
The print button is:
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
63
63
6363
Page 64
Method:
isPrintButtons()
E.g. var buttonVisible = ViewONE.isPrintButtons();
Returns a Boolean value of ‘true’ if the print bu tton is vi sible else a v alue ‘false’ is returned .
Method:
Method:
setInvertButtons(tr ue/false)
E.g. View ON E.se tIn v er tB utto n s( tru e) ;
Specifies whether the toolbar includes an invert button. A value o f ‘true’ (de fault) indicates
the button is visible and ‘false’ indicates it is not.
The inve rt b u tton i s :
isInvertButtons()
E.g. var buttonVisible = ViewONE.isInvertButtons();
Returns a Boolean value of ‘true’ if the invert bu tton is v isible else a v alue ‘ false’ is
returned.
Method:
setNewWindowButtons(t rue/false)
E.g. ViewONE.setNewWindowButtons(true);
Specifies whether the toolbar includes a new-window button. A value o f ‘true’ (de fault)
indicates the button is visible and ‘false’ indicates it is not.
The new-window button is:
64
64
6464
Page 65
Method:
Method:
isNewWindowButtons()
E.g. var buttonVisible = ViewONE.isNewWindowButtons();
Returns a Boolean value of ‘true’ if the new -window button is visible else a value ‘ false’ is
returned.
setViewButtons(true/false)
E.g. View ON E.se tV ie w Bu tton s(t rue ) ;
Specifies whether the toolbar includes view buttons. A value of ‘true’ (default) indicates
the buttons are visible and ‘false’ indicates they are n ot.
The view buttons are:
Fullpage, Thumbnails, Two-page, Thumbs-left, Thumbs-bottom, Thumbs-right, Thumbs-
top.
Method:
Method:
isViewButtons()
E.g. var buttonsVisible = ViewONE.isViewButtons();
Returns a Boolean value of ‘true’ if the v iew buttons are visible else a value ‘ false’ is
returned.
setAllButtons( true/false)
E.g. View ON E.se tA ll Bu tto ns( true);
Specifies whether all buttons are visible or not (these are file, print, image, new-w indow
and view buttons). A value of ‘true’ (default) indicate s the buttons ar e visible a nd ‘ false’
indicates they are not.
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
65
6565
65
Page 66
Method:
Method:
isAllButtons()
E.g. var buttonsVisible = ViewONE.isAllButtons();
Returns a Boolean value of ‘true’ if the all buttons ar e visible else a value ‘ false’ is returned
(these are file, print, image, new-window and view buttons)
setPageButtons(true/false)
E.g. View ON E.se tP a geBu tto n s( tru e) ;
Specifies whether the toolbar includes page buttons. A value of ‘true’ (de fault) indicates
the buttons are visible and ‘false’ indicates they are n ot.
The page buttons are:
First page, previous page, next page, last page and a drag bar for pa ge selection..
Method:
isPageButtons()
E.g. var buttonsVisible = ViewONE.isPageButtons();
Returns a Boolean value of ‘true’ if the page bu ttons are v isible else a value ‘ false’ is
returned.
66
6666
66
Page 67
Method:
(V3-Only)
Method:
(V3-Only)
toggleAdjustTool()
E.g. ViewONE.toggleAdjustTool();
This method toggles the visibility of the adjust tool (brightness/contrast/luminance).
setAdjustToolVisible(OnOff)
E.g. ViewONE.setAdjustToolVisible(True);
This method sets the visibility of the adjust tool (brightness/contrast/luminance).
Method:
(V3-Only)
isAdjustToolVisible()
E.g. var onOff = ViewONE.isAdjustToolVisible();
This method returns the visibility of the adjust tool (brightness/contrast/luminance).
67
6767
67
Page 68
Menus and keys
Method:
setFileMenus(true/false)
E.g. View ON E.se tF il eMenus(true );
Specifies whether the file pop-up menus are available (usin g mouse bu tton 2/3). A v alue of
‘true’ (default) indicates the menus are available and ‘false’ indicates they are not.
The menu i s as fol l ow s :
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
Method:
IsFileMenus()
E.g. var menusEnabled = ViewONE.isFileMenus();
Returns a Boolean value of ‘true’ if the menus a re enabled else a v alue ‘ false’ is returned.
68
68
6868
Page 69
Method:
Method:
setViewMenus(true/f al se)
E.g. View ON E .se tVi ew M enu s( true ) ;
Specifies whether the view pop-up menus a re available (using mouse bu tton 2/3). A value
of ‘true’ (default) indicates the menus are available and ‘false’ indicates they ar e not.
The menu i s as fol l ow s :
isViewMenus()
E.g. var menusEnabled = ViewONE.isViewMenus();
Returns a Boolean value of ‘true’ if the menus a re enabled else a v alue ‘ false’ is returned.
69
6969
69
Page 70
Method:
setImageMenus(true/f alse)
E.g. ViewONE.setImageMenus(true);
Specifies whether the image pop-up menus are av ailable (using mouse button 2/3). A
value of ‘true’ (default) indicates the menus are available and ‘ false’ indicates they are not.
The menu i s as fol l ow s :
Method:
isImageMenus()
E.g. var menusEnabled = ViewONE.isImageMenus();
Returns a Boolean value of ‘true’ if the menus a re enabled else a v alue ‘ false’ is returned.
70
7070
70
Page 71
Method:
setPrintMenus(true/fal se)
E.g. View ON E.se tP rin tMenus(true );
Specifies whether the print pop-up menus are available (usin g mouse button 2 /3). A value
of ‘true’ (default) indicates the menus are available and ‘false’ indicates they ar e not.
The menu is as follows:
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
Method:
isPrintMenus()
E.g. var menusEnabled = ViewONE.isPrintMenus();
Returns a Boolean value of ‘true’ if the menus a re enabled else a v alue ‘ false’ is returned.
71
7171
71
Page 72
Method:
setPageMenus(true/fa lse)
E.g. ViewONE.setPageMenus(true);
Specifies whether the page pop-up menus a re available (using mouse bu tton 2/3). A v alue
of ‘true’ (default) indicates the menus are available and ‘false’ indicates they ar e not.
The menu i s as fol l ow s :
Method:
isPageMenus()
E.g. var menusEnabled = ViewONE.isPageMenus();
Returns a Boolean value of ‘true’ if the menus a re enabled else a v alue ‘ false’ is returned.
72
7272
72
Page 73
Method:
setSelectMenus(true/false)
E.g. ViewONE.setSelectMenus(true);
Specifies whether the select pop-up menus a re available (using mouse button 2/3). A
value of ‘true’ (default) indicates the menus are available and ‘ false’ indicates they are not.
The menu i s as fol l ow s :
Method:
isSelectMenus()
E.g. var menusEnabled = ViewONE.isSelectMenus();
Returns a Boolean value of ‘true’ if the menus a re enabled else a v alue ‘ false’ is returned.
73
7373
73
Page 74
Method:
setPreferenceMenus(t rue/f alse)
E.g. ViewONE.setPreferenceMenus(true);
Specifies whether the preference pop-up menus a re available (usin g mouse b utton 2/3 ). A
value of ‘true’ (default) indicates the menus are available and ‘ false’ indicates they are not.
The menu i s as fol l ow s :
Method:
isPreferenceMenus()
E.g. var menusEnabled = ViewONE.isPreferenceMenus();
Returns a Boolean value of ‘true’ if the menus a re enabled else a v alue ‘ false’ is returned.
74
7474
74
Page 75
Method:
Method:
setAllMenus(true/f alse )
E.g. ViewONE.setAllMenus(true);
Specifies whether the all pop-up menus are available. A value o f ‘true’ (default) indicates
the menus are available and ‘false’ indicates they a re no t.
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
isAllMenus()
E.g. var menusEnabled = ViewONE.isAllMenus();
Returns a Boolean value of ‘true’ if the menus a re enabled else a v alue ‘ false’ is returned.
menus are available and ‘false’ indicates they are not.
Method:
Method:
setFileKeys(t rue/false)
E.g. ViewONE.setFileKeys(true);
Specifies whether the hot keys for file operations are enabled . A v alue of ‘true’ (default)
indicates the keys are enabled and ‘false’ indicates they are not.
The keys are as follows:
Open File O
Open URL Shift-O
Close C
Save F
New window W
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
isFileKeys()
E.g. var keysEnabled = ViewONE.isFileKeys ();
Returns a Boolean value of ‘true’ if the keys are ena bled else a v alue ‘ false’ is returned.
75
7575
75
Page 76
Method:
Method:
setImageKeys( true/f alse)
E.g. View ON E .se tIma ge K ey s(tru e ) ;
Specifies whether the hot keys for image operations are enabled. A value o f ‘ true’
(default) indicates the keys are enabled and ‘false’ indicates they are no t.
The keys are as follows:
Fit to window width F9
Fit to window height F10
Fit to window F11
Zoom in Add
Zoom out Subtract
Magnifier M
Zoom to 100% Z
Zoom area A
Rotate clockwise R
Rotate counte rcl oc kwi se L
Enhance E
Invert I
isImageKeys()
E.g. var keysEnabled = ViewONE.isImageKeys ();
Returns a Boolean value of ‘true’ if the keys are ena bled else a v alue ‘ false’ is returned.
76
7676
76
Page 77
Method:
Method:
setPrintKeys(true/false)
E.g. ViewONE.setPrintKeys(true);
Specifies whether the hot keys for print operations are enabled. A value o f ‘true’ (default)
indicates the keys are enabled and ‘false’ indicates they are not.
The keys are as follows:
Print page P
Print document Shift-P
Print page ran ge Ctrl-P
Print selected pages Ctrl-Shift-P
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
isPrintKeys()
E.g. var keysEnabled = ViewONE.isPrintKeys ();
Returns a Boolean value of ‘true’ if the keys are ena bled else a v alue ‘ false’ is returned.
Method:
setViewKeys(t rue/fals e)
E.g. View ON E .se tVi ew K ey s(true ) ;
Specifies whether the hot keys for view operations are enabled. A v alue of ‘true’ (default)
indicates the keys are enabled and ‘false’ indicates they are not.
The keys are as follows:
View page F2
View thumbnails F3
View two page F4
View thumbnails: Left F5
View thumbnails: Bottom F6
View thumbnails: Right F7
View thumbnails: Top F8
77
7777
77
Page 78
Method:
Method:
isViewKeys()
E.g. var keysEnabled = ViewONE.isViewKeys ();
Returns a Boolean value of ‘true’ if the keys are ena bled else a v alue ‘ false’ is returned.
setPageKeys(tr ue/false)
E.g. View ON E.se tP a geKe y s(true ) ;
Specifies whether the hot keys for page operations are enabled. A value o f ‘ true’ (default)
indicates the keys are enabled and ‘false’ indicates they are not.
The keys are as follows:
Next page Page Down
Previous page Page Up
First page Home
Last page End
Method:
Method:
isPageKeys()
E.g. var keysEnabled = ViewONE.isPageKeys ();
Returns a Boolean value of ‘true’ if the keys are ena bled else a v alue ‘ false’ is returned.
setSelectKeys( true/f alse)
E.g. View ON E.se tS el ectK e ys(tru e );
Specifies whether the hot keys for select operations are e nabled. A value o f ‘ true’ (default)
indicates the keys are enabled and ‘false’ indicates they are not.
The keys are as follows:
Select page S
Clear Selections Shift-S
78
7878
78
Page 79
Method:
Method:
Method:
isSelectKeys()
E.g. var keysEnabled = ViewONE.isSelectKeys ();
Returns a Boolean value of ‘true’ if the keys are ena bled else a v alue ‘ false’ is returned.
setAllKeys(t rue/false)
E.g. View ON E.se tA ll Ke ys(tru e );
Specifies whether the all hot keys are enabled or n ot. A value o f ‘true’ (default) indicates
the keys are enabled and ‘false’ indicates they a re n ot.
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
isAllKeys()
E.g. var keysEnabled = ViewONE.isAllKeys ();
Returns a Boolean value of ‘true’ if the keys are ena bled else a v alue ‘ false’ is returned.
79
7979
79
Page 80
Timeout/User Idle Control
Method:
Method:
setTimeout(seconds)
E.g. var ready = ViewONE.setTimeout(30);
This method sets and starts a usage timer. If the use r does not use the ap plet for the
number of seconds specified then the applet w ill automatically be disabled. It can be reenabled by calling one of the timeout JavaScript methods (see below), openin g a
document using one of the JavaScript open methods, by revisiting the page c ontaining the
applet (Netscape) or reloading the page (Internet Explorer).
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
getTimeout()
E.g. var seconds = ViewONE.getTimeout();
This method returns the timeout value (integer seconds) set using either the s etTimeout()
method or the HTML tag “timeout”.
Method:
Method:
stopTimeout()
E.g. ViewONE.stopTimeout();
This method will disable the timer set using either the setTimeout() method or the HTML
tag “timeout” and if the applet had timed-out then it w ill wake-up (i.e. be re-enabled).
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
isTimedOut()
E.g. var timedout = ViewONE.isTimedOut();
This method returns a value of true if the applet has timed-out as a result o f the user not
using the applet for the time specified by the se tTimeout() method o r the H TML tag
“timeout” . I t o the rw i se re tu rn s fal se .
80
8080
80
Page 81
Method:
Method:
getTimeLeft()
E.g. var tim ele ft = Vie wON E. getTi meL eft ();
This method returns the time in seconds left before the applet times-out. but o nly if the
setTimeout() method or HTML tag “timeout” has been used to set the time in the first
place. It otherwise returns 0. The time left is automa tically reset each time the user
performs any action, such as scrolling, changing pa ges, zooming etc.
wakeUp()
E.g. ViewONE.wakeUp();
This method will wake-up the applet if it has timed out (see setTimeout()). The user will
then be able to use the applet as nor mal.
Security note: This method is disabled by default unless the
“JavascriptExtensions” parameter is set to “ true”.
81
8181
81
Page 82
The Event Handler and Event Handling
ViewONE introduces the concept of applet JavaScript event handlin g. This is a
mechanism by which it is possible to use Jav aScript to monitor user activ ity and other
selected actions performed by the ViewONE applet.
This can be a powerful facility, for example, it allows user activity and usa ge to be lo gged
and/or actions to be performed dependent on what the use r is doin g/has done (e.g. charge
for specific services like printing, perform actions on double-clicks, moni tor documents
opened etc).
The event handling is first enabled by the use of the HTML tag “even tHandler” and the
MayScript tag (see example below). The eventHandler ta g must be se t to th e name o f a
JavaScript fu n ctio n con for min g to th e fo ll ow i ng specification.
When the applet is initialized, it will call this function, passing it parameters relevant to the
action performed as described below.
The JavaScript ‘event handler’ must be specified with two pa rameters; id (integer) and text
(String), but can be any name of your choice, a s follows…
Function myEventHandler(id, text)
{
alert(“Event received, id=“+id+”, text=“+tex t);
}
In this example, the event handler just displays a noti ce to the use r that a n eve nt had been
received. You are however free to do whatever y ou need, for example testing the value of
the id and text fields then taking further actions as ne cessary.
82
8282
82
Page 83
Events handler change in Vie wONE Version 3
Prior to ViewONE Version 3, all events were signaled irrespective of whether the ev ent
was required. However, Version 3 introduced an event filter so that only those events tha t
are desired are signaled to the event handler.
Version 3 requires an additional HTML parameter w hich specifies the event Id’ s that are
desired (see below for full list of Id’s).
* Note: Without this parameter no events will be signaled.
The param ete r ta ke s th e fo rm o f a si mp le l is t, e. g…
<param name="eventInterest" value="9, 37, 39">
In this example, events 9, 37 and 39 are si gnaled.
83
8383
83
Page 84
y
Events ids and descript ions
ViewONE can signal many different events to the event handler .
The following list describes the events that will be received by this function (over
page)…and the next page after provides a full example.
Id Event Text Description
1 Reserved.
2 Reserved.
3 printpage: page n of n User has printed a page.
4 printvisible: page n of n User has printed the visible part of a page
5 opened: url User has opened a document
6 saved: page n of nUser has saved a page
7 click: page n of n User has clicked on a page
8 dblclick: page n of n User has double-clicked on a page
9 page: page n of n User has changed page
10 timeout: page n of n
11 Reserved.
12 select page: page n of n User has selected a page
13 unselect page: page n of n User has unselected a page
14 mouse down: page n of nUser has pressed a mouse button
15 mouse up: page n of nUser has released a mouse button
16 Reserved.
17 Reserved.
18 Reserved.
Indicates the applet has timed-out. See JavaScript method setTimeout()
and HTML tag “timeout”
19 Reserved.
20 set document: doc n of n
21 end tab
User has selected the next document in the list (this applies only when the
“doc<N>“ HTML tag is used – see HTML manual)
The user has used the tab key to change focus while the last focusable
component in ViewONE already had focus. ViewONE w ill as sign focus
back to the first in its list, however
84
8484
ou may override ViewONE by using this
84
Page 85
p
)
event to switch focus to any alternative component on your web page.
22 ready The applet has just been started and is ready to accept JavaScript calls.
23 annotation hyperlink
The user has activated an annotation (JavaScript) hyperlink (see
annotations configuration manual).
24 annotations save ok Annotations have just been saved.
25 annotations save failed The annotations save operation has just failed.
26 print cancelled A print dialog or print job has been cancelled.
27
print ended A print job has been successfully sent to the printer.
28 Reserved.
29 Reserved.
30 annotation created The user has added an annotation through the user in terface.
This event can fire with two different n valu e s…
- if n is 1, it means that ViewONE could not create the save files in its own
31 SaveDocument Failed(n)
cache (prior to sending them to the destination). One way this might
happen is if the disk was full.
- if n is 2, it means that ViewONE could not copy the save files to the
specified destination.
Gets fired whenever a document’s annotations set is modified. It can,
32 annotations updated: page n of n
therefore, be used to indicate that the document’s annotations now require
saving.
33 annotations restored: page n of n
therefore, be used to indicate that the document’s annotations no longer
require saving.
Gets fired whenever a document’s annotations set is restored. It can,
34 Page rendered
35 Area Selected
The image for the current page has been rendered/updated. This event
occurs on every redraw/refresh. See event 38/39 for filtered versions.
An area of the current page has been selected by the user (using the zoom
area tool).
36 Reserved
A key has been pressed (key defined in the event).
Notes:
It is strongly recommended that you turn off key processing by ViewONE by
using the HTML parameter ProcessKeys set to False, otherwise ViewONE
will process keys AND generate events.
37 Key pressed
It is also strongly recommended that you set up a test to display the event
text before assuming that value of that text because some keyboards may
differ in the te x t an d may a lso d if fer a cco rd in g to the lo cal iz atio n se tup of
your machine.
The following keys do not generate events..
- Keys processed when editing a text annotation
- SHIFT, CTRL and ALT Keys (instead, when a key is pressed a marker is
included to indicate when these keys are pressed with other keys –see
les below
exam
85
85
8585
Page 86
- Windows main menu key
- Popup menu key
The following keys will generate eve nts but w ill alw ays also be handled b y
ViewONE event when ProcessKeys is set to False…
- Scroll bar keys (Page up/down, home, end, arrow keys)
- Windows menu key
Modifier and cursor keys are defined using names (see below)
Examples:
Event Text Descr ip tio
“A” A key pressed
Control A Ctrl + A keys pressed
Shift A Shift + A key s pr e sse d
Alt A Alt + A keys pressed
Alt Shift Control A Alt Shift + Ctrl + A key s presse d
Space Space key pressed
Ctrl Space Ctrl + Space keys pressed
Caps Lock Caps Lock pressed
Up Up arrow key pressed
Numpad-9
38 Full page rendered
39 All full pages rendered
40 Reserved
41 Keep Alive
A page has been viewed in the full-page panel. This event only occurs the
first time the page is viewed.
All pages in the document have been viewed in the full-page panel. This
event occurs only once per document.
This event is generated at regular intervals (specified by the KeepAliveTime
HTML paramater). The text accompanying the event is specified by the
KeepAlive HTML paramater.
9 key on a number pad is pressed (note
some numpad keys have a ‘-‘ separator
rather than a space)
42 Save Complete Generated when a document is successfully saved.
43 Cache Access Denied
This event is generated if all attempts to write to a ViewONE cache have
failed.
There may be cases where ‘LiveConnect’ is not implemen ted (older brow sers or some
browser implementations on non-MS Windows platforms) which w ill mean Jav aScript
cannot call applet methods and the event handler functionality will not w ork. In all other
cases the following methods may help in debu gging potential ev ent handler p roblems…
You need to make sure the May Script and eventHandler tags are speci fied. If y ou have
made a mistake with either then the following methods will help indicate where the
problem lies…
isEventHandlerOK()
getEventHandlerError()
And can be used as follows…
If (!document.ViewONE.isEventHandlerOK())
If you receive an error message when the applet attempts to call y our event handler, then
assuming LiveConnect is enabled, the most likely cause is that the inco rrect name for your
event handler was supply to ViewONE. Note that Ja vaScript function n ames a re case
sensitive.
The MayScript tag
The MayScript tag is required if any applet is to call J avaScript methods. This tag w as
introduced by Netscape and is also implemented in Internet Explorer. We have how ever
noticed that the use of this tag can reduce s tart-up per formance for Netscape 4 becau se i t
appears to force all applets to be recompiled with each inv ocation. Netsca pe 7 how ever
does not suffer from this problem.
88
8888
88
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.