-
ViewONE JavaScript API Manual Version 3.0 Last Updated: 04th May 2005 Copyright Daeja Image Systems. All Rights Reserved. Email: info@daeja.com Web site: http://www.daeja.
-
D A E J A I M A G E S Y S T E M S Contents Introduction ................................................................................................................................................ 7 The Applet user interface ........................................................................................................................... 8 ViewONE Standard..........................................................................................................................................
-
D A E J A I M A G E S Y S T E M S Specifying an Annotations File .......................................................................................................................... 26 setAnnotationFile(filename)................................................................................................................................................ 26 Saving documents and images ..................................................................................................................
-
D A E J A I M A G E S Y S T E M S zoomOut() ........................................................................................................................................................................... 42 zoom100() ........................................................................................................................................................................... 42 setZoom(zoom) ...........................................................................................
-
D A E J A I M A G E S Y S T E M S printDocument() .................................................................................................................................................................. 56 printRange() ........................................................................................................................................................................ 56 printSelected() ............................................................................................
-
D A E J A I M A G E S Y S T E M S isFileKeys() ......................................................................................................................................................................... 75 setImageKeys(true/false)..................................................................................................................................................... 76 isImageKeys() ..................................................................................................
-
Introduction ViewONE is a Java applet that extends your web browser so that you can view, zoom, magnify, scroll, pan, rotate and print your images and image documents quickly and easily. This document is the ViewONE JavaScript Manual and covers how to use and what options are available for the ViewONE JavaScript API. This document is designed to be used in conjunction with the ViewONE HTML and Installation Manual.
-
The Applet user interface File Open, Close and Save 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 Toolbar Toggle Vertical scrollbar Image Area Drag mouse to pan image Scroll to First, Previous, Next and Last Page Document Information Enhance mode View Fullpage, Thumbnails, Two pages Thumbs-left, Thumbs bo
-
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”. This directory contains the essential files required to install and use ViewONE. Copy all files found in the “v1files” directory to your web server, preferably in a separate directory similarly named.
-
ViewONE Pro If you have downloaded ViewONE Pro (with or without the Print Accelerator, Annotations, DjVu, PDF or other optional modules), then to use ViewONE Pro on your web site, setup a web page containing the following HTML…
-
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 later) and Apple Macintosh X (10.x) can use IE5, Netscape 7 or Mozilla. IE uses Apples run-time Java (called MRJ). Since the release of IE4.5 Apple have released several versions of MRJ. It is recommended that users use MRJ version 2.2 or later.
-
Setting up Windows 2003 server If your server is running Windows 2003 with IIS 6, you will have to add two file extensions to your web site “MIME Types”. Unlike previous Windows servers, Windows 2003 permits only a limited number of file extensions by default, all others must be enabled manually using the IIS console. The additional mime types required to operate ViewONE are “.v1” and “.ant”.
-
Click on the properties menu to display the properties dialog… Click on the MIME Type button to display the MIME Type dialog… Use the New button to add two new MIME types… 13
-
Click OK until you return back to the main console dialog. Right click once again on the main web space entry. Click on the Restart IIS menu to activate the new MIME Types.
-
ViewONE JavaScript Overview The ViewONE Javascript API offers an alternative mechanism to configure and control the ViewONE applet. In many cases the use of the Javascript API will not be required simply because most configuration parameters can be implemented using simple HTML (see ViewONE HTML manual).
-
JavaScript Reference The JavaScript examples in this manual do not refer to their use in any particular context. The examples could be used within functions of a JavaScript program or directly as event handlers to buttons, hyper-links etc. Our web site illustrates such uses; alternatively refer to an appropriate JavaScript guide. Filenames and hyperlink addresses are expressed using the Internet URL address format (Uniform Resource Locator), e.g. “http://mysite/myimage.tif”.
-
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 document during HTML 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 synchronize calls to ViewONE.
-
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 } 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 handler.
-
Opening documents and images Method: openFile(filename, page) E.g. ViewONE.openFile(“myimages.tif”, 1); Specifies the filename and initial page of the document to be viewed. This filename can specify either the filename relative to the code base (as above) or the full URL. The code base is specified in the HTML 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); Method: closeDocument() E.g. ViewONE.
-
Initializing the page and thumb arrays causes a ‘soft’ close to be performed, i.e. the current document is closed and the annotation source, templates and background images are reset if a document is currently open. If no document is currently open, then the close and reset is not performed.
-
Method Group: initializePageAndThumbsArray(numPages) setPageArray(filename, page) setThumbsArray(filename, page) openPageArray(page) E.g. ViewONE.initializePageAndThumbsArray(3); ViewONE.setPageArray(“page1.tif”, 0); ViewONE.setThumbsArray(“page1-t.tif”, 0); ViewONE.setPageArray(“page2.tif”, 1); ViewONE.setThumbsArray(“page2-t.tif”, 1); ViewONE.setPageArray(“page3.tif”, 2); ViewONE.setThumbsArray(“page3-t.tif”, 2); ViewONE.openPageArray(1); These methods are similar to the previous.
-
Method Group: initializeDocumentArray(numDocs) setDocumentArray(filename, index) openDocumentArray() E.g. ViewONE.initializeDocumentArray(3); ViewONE.setDocumentArray(“doc1parameters.txt”, 0); ViewONE.setDocumentArray (“doc2parameters.txt”, 1); ViewONE.setDocumentArray (“doc3parameters.txt”, 2); ViewONE.
-
Method: reloadList() E.g. ViewONE.reloadList() This method forces the list used with the openList() method to be reloaded and the document to be re-opened. It will reload the list file from source (i.e. the web server) each time, so if it has changed then the changes will be picked up. Method: openDoc(index) E.g. ViewONE.openDoc(2) This method applies only when the “doc” HTML parameter is used (see HTML manual). The value of “index” represents the associated “doc” parameter.
-
Method: setPage(page) E.g. ViewONE.setPage(2); Sets the current page number (an integer). Method: getPage() E.g. var page = ViewONE.getPage(); Returns the current page number as an integer. Method: nextPage() E.g. ViewONE.nextPage(); Convenience method to view the next page (current page + 1) Method: previousPage() E.g. ViewONE.previousPage(); Convenience method to view the previous page (current page - 1). Method Group: setDescription(description) getDescription() E.g. var desc = ViewONE.
-
Method: getDocReference() E.g. Var ref = ViewONE.getDocReference(); Gets the document reference for the document. Method: 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 was loaded from a web server then this value will be the local ‘cached’ version of the image file.
-
Specifying an Annotations File Method: setAnnotationFile(filename) E.g. ViewONE.setAnnotationFile(“http://mysite/myannotations.ant”); This method sets the annotation file and must be called before any of the open methods described above. If the current document is closed after this method has been called, the annotation file will be reset.
-
Saving documents and images Method: save(filename) E.g. ViewONE.save(“c:/temp/image.tif”); Saves the current document (multi-page tiffs), or current page (multi-file documents) to the specified filename. If filename is null, either the save dialog is displayed or, if a server side save component has been specified, the image is sent to the server side component.
-
Method: isMultipageTif() E.g. vat ismulti = ViewONE.isMultipageTif(); This method is useful if you want to first check whether the current document is a multipage tif before using the above methods.If it is then this method returns true else it returns false.
-
Document hyperlinks Method: setHyperlink(url, dblClick) E.g. ViewONE.setHyperlink(“newpage.html”, false); or ViewONE.setHyperlink(“http://mysite/newpage.html”, false); Specifies a hyperlink that is activated when the user clicks on the image 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.
-
PDF Viewing Options (Pro-Only) ViewONE Pro introduced an optional PDF module. The module comes with various optional methods as follows... Method: setPDFPixelDepth(pixeldepth) (Pro-Only) E.g. ViewONE.setPDFPixelDepth(8); This method will change the default pixel depth when viewing PDF documents. The pixel depth dictates the number of colors that are used for viewing as follows: PixelDepth 1: 8: 24: View in Monochrome format (black and white) View in Grayscale (256 grays) View in full color (4.
-
Method: getPDFResolution() (Pro-Only) E.g. var depth = ViewONE.getPDFResolution(); Returns the current resolution used when viewing PDF documents. Method: setAutoLimitPDFResolution(true/false) (Pro-Only) E.g. ViewONE.setAutoLimitPDFResolution(true); When the parameter is set to true, ViewONE will dynamically limit the PDF resolution in order to obtain maximum performance when viewing PDF documents.
-
The best value for you can only really be discovered by experimentation since it depends upon your documents, PC and network performance and user preferences. Method: getAutoLimitPDFMemoryValue() (Pro-Only) E.g. var limit = ViewONE.getAutoLimitPDFMemoryValue(); Returns the current limiting value used when viewing PDF documents.
-
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 document that has both text and image content and is usually used with forms packages.
-
Method: setBackgroundImage(filename, pageNumber) (Pro-Only) E.g. ViewONE.setBackgroundImage(“mybackimage.tif“, 1); This method is used to set the COLD background template for all pages in a document. The pageNumber paramater is used where the file used for the backround supports multiple pages, such as TIF and PDF files. Note: this method must be called before opening a document.
-
Method: setBackgroundImageEnabled(true/false) (Pro-Only) E.g. ViewONE.setBackgroundImageEnabled(false); This method is used to change the visibility of the COLD template image. A value of false will remove the template from view, and a value of true will show the template. Method: isBackgroundImageEnabled() (Pro-Only) E.g. var inverted = ViewONE.
-
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 with large documents can offer better performance than thumbnails (due to not having to handle image decompression display). ViewONE offers a default text index which displays page numbers; however the list may be customized using the following method. Method: setIndexListFile(URL) (Pro-only) E.g. ViewONE.
-
Image Method: 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. Method: setInverted(true/false) (V3-Only) E.g. ViewONE.
-
Method: isEnhance(true/false) E.g. var enhance = ViewONE.isEnhance(); Returns a Boolean ‘True’ if enhance is on, ‘False’ if it is off. Method: setEnhanceMode(mode) E.g. ViewONE.
-
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 given size. Method: setRotationArray(int angle, int page) E.g. var ok = ViewONE.setRotationArray(90, 0); Sets the rotation for given page to the given angle. The pages are indexed from 0, so the first page is zero, the second is 1 etc. The specified angle should be one of 0, 90, 180 or 270.
-
Method: rotateClockwise() E.g. ViewONE.rotateClockwise(); 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. Method: rotateCounterclockwise() E.g. ViewONE.rotateCounterclockwise(); Convenience method to decrease the rotation by 90 degrees.
-
Method: getFlip() E.g. var angle = ViewONE.getFlip(); Returns the flip mode as an integer. Method: setScale(scale) E.g. ViewONE.setScale(0); Specifies the scale mode used to display a page. Acceptable integer values are: 0: best fit The page is scaled to fit into the window area so that the entire page is visible. 1: Fit-to-window-width The page is scaled so that the width of the page matches the width of the window area.
-
Method: setStates(string states) E.g. ViewONE.setStates(states); Sets the zoom, scroll and other states to the values specified by the coded string. This method should be called before opening a document. The getStates() and setStates() methods together permit the viewing states to be restored when a document is closed and re-opened. Method: zoomIn() E.g. ViewONE.zoomIn(); Applies a 25% increase in zoom.
-
Method: setZoom(zoom) E.g. ViewONE.setZoom(2.0); Zooms to the value specified. The value is specified as a double value - 1.0 = 100% or 1 image pixel = 1 screen pixel, 2.0 = 200% or 1 image pixel = 2 screen pixels. If used in conjunction with setXYScroll, it is advisable to use setZoomAndXYScroll instead as problems may occur when both setZoom and setXYScroll are used together. Method: setZoomAndXYScroll(zoom, x, y) E.g. ViewONE.setZoomAndXYScroll(2.0, 100, 100); Zooms to the value specified.
-
Method: setDraggingEnabled(true/false) E.g. ViewONE.setDraggingEnabled(true); Specifies whether the dragging of the image is permitted 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 dragging is permitted and ‘false’ indicates that it is not Method: isDraggingEnabled() E.g. var draggingEnabled = ViewONE.
-
Method: getBrightness() E.g. var percent = ViewONE.getBrighness(); Returns the current brightness percentage setting (0-100). Method: setContrast(percent) E.g. ViewONE.setContrast(40); This method sets the contrast of the image displayed. The value represents a percentage from 0-100, with 50 being the default value. 0 = minimum contrast (flat) and 100 = maximum brightness (not flat!). If the document is closed when this method is called, the default for all pages is modified.
-
Method: setLuminance(percent) E.g. ViewONE.setLuminance(70); This method sets the luminance of the image displayed. The value represents a percentage from 0-100, with 50 being the default value. 0 = minimum luminance (dull) and 100 = maximum brightness (bright). 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.
-
getImageHeight() E.g. var height = ViewONE.getImageHeight(); Returns an integer value representing the height of the currently displayed image in image pixels. Method: getXResolution() E.g. var xRes = ViewONE.getXResolution(); Returns an integer value representing the x-axis resolution of the currently displayed 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. Method: getYResolution() E.
-
Viewing Method: setView(view) E.g. ViewONE.setView(0); Specifies the view mode used to display pages of a document. This method is effective only while a document is open. Acceptable integer values 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 of the current page with thumbnails on the left of the page.
-
Method: setAreaZoom(true/false) E.g. ViewONE.setAreaZoom (true); If true, initiates the zoom-area mode. The mouse pointer changes to a cross and the user can drag the mouse (using button one) to select an area for zooming. When the mouse button is released the area selected will be zoomed as large as possible whilst maintaining the image aspect within the available window area. If the selected area is not greater than the zoom trigger size (currently 20*20 pixels) then zooming will not occur.
-
Method: setMagnifierInternal(true/false) E.g. ViewONE.setMagnifierInternal(true); If true, displays a magnifier window internal to the display area. If false, the magnifier window is hidden.
-
Method: isMagnifier() E.g. var magVisible = ViewONE.isMagnifier(); Returns a Boolean value indicating the magnifier visibility status. Method: toggleMagnifier() (V3-Only) E.g. ViewONE.toggleMagnifier(); Toggles the magnifier on/off. Method: setMagFactor() E.g. ViewONE.setMagFactor(int factor); Sets the current integer magnification factor (for magnifier window) Method: getMagFactor() E.g. var factor = ViewONE.
-
Method: isNewWindowVisible() E.g. ViewONE.setNewWindowVisible(!ViewONE.isNewWindowVisible()); Returns a Boolean value of ‘true’ if the ViewONE new window is visible else a value ‘false’ is returned. Method: setImageForeColor(color) (V3-Only) E.g. ViewONE.setImageForeColor(0, 0, 0) This method sets the default color used for the foreground (text) of monochrome images. Colors are specified using the standard RGB values. Method: showImageForeColorDialog() (V3-Only) E.g. ViewONE.
-
Method: setImageBackColor(color) (V3-Only) E.g. ViewONE.setImageBackColor(255, 255, 255) This method sets the default color used for the background of monochrome images. Colors are specified using the standard RGB values. Method: showImageBackColorDialog() (V3-Only) E.g. ViewONE.showImageBackColorDialog(); This method will cause ViewONE to display a dialog to allow the user to change the default color used for the background of monochrome images.
-
Labels Method Group: initializeLabels(numLabels) setLabel(pageLabel, pageLabelColor, thumbLabel, thumbLabelColor, labelNum) useLabels() clearLabels() 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.
-
Selection and clipboard Method: selectPage(int pageNumber) E.g. ViewONE.selectPage(4); Toggles the select property on the page in a document indicated by the “pageNumber” parameter (available for multi-page documents only). Method: clearSelections() E.g. ViewONE.clearSelections(); Clears all page selections in the document (available for multi-page documents only). Method: copyPageToClipboard() E.g. ViewONE.copyPageToClipboard(); Produces a print dialog to allow the user to print the current page.
-
Printing 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”. Method: printDocument() E.g. ViewONE.printDocument(); Produces a print dialog to allow the user to print the current document (available for multipage documents only).
-
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 within a document. Security note: This method is disabled by default unless the “JavascriptExtensions” parameter is set to “true”. Method: printVisible() E.g. ViewONE.
-
Method: isPrintDialog() E.g. var dialog = ViewONE.isPrintDialog(); Returns a Boolean ‘True’ if the print dialog is enabled, ‘False’ if it is not. Method: 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 of copies that will be printed when printing a page, pages or the document. Method: setPrinter(string) E.g. ViewONE.
-
Method: setPrintHeader(headerString) E.g. ViewONE.setPrintHeader(“$page # $of ##”) Printouts can include custom text at the top of each page. By default this text is set to the page number followed by the number of pages in the document. 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 printed page.
-
Method: setPrintAutoRotate (true/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 printed (vertically) on a printed page as possible. The default value for this tag is false.
-
Toolbars and Buttons Method: setScrollbars(true/false) E.g. ViewONE.setScrollbars(true); Specifies whether scrollbars will appear when the image is scaled to a size 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 of the display (e.g. when a page is zoomed or unzoomed or a page is changed etc.). Method: isScrollbars() E.g. var scrollbars = ViewONE.
-
Method: setFileButtons(true/false) E.g. ViewONE.setFileButtons(true); Specifies whether the toolbar includes file buttons. A value of ‘true’ (default) indicates the buttons are visible and ‘false’ indicates they are not. The file buttons are: Open, Close, Save. Security note: This method is disabled by default unless the “JavascriptExtensions” parameter is set to “true”. Method: isFileButtons() E.g. var buttonsVisible = ViewONE.
-
Method: setImageButtons(true/false) E.g. ViewONE.setImageButtons(true); Specifies whether the toolbar includes image buttons. A value of ‘true’ (default) indicates the buttons are visible and ‘false’ indicates they are not. The image buttons are: Zoom area, Zoom in, Zoom out, Fit to width, Fit to height, Best fit, Rotate clockwise, Rotate counterclockwise, Rotate 180. Security note: This method is disabled by default unless the “JavascriptExtensions” parameter is set to “true”.
-
Method: isPrintButtons() E.g. var buttonVisible = ViewONE.isPrintButtons(); Returns a Boolean value of ‘true’ if the print button is visible else a value ‘false’ is returned. Method: setInvertButtons(true/false) E.g. ViewONE.setInvertButtons(true); Specifies whether the toolbar includes an invert button. A value of ‘true’ (default) indicates the button is visible and ‘false’ indicates it is not. The invert button is: Method: isInvertButtons() E.g. var buttonVisible = ViewONE.
-
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. Method: setViewButtons(true/false) E.g. ViewONE.setViewButtons(true); Specifies whether the toolbar includes view buttons. A value of ‘true’ (default) indicates the buttons are visible and ‘false’ indicates they are not.
-
Method: isAllButtons() E.g. var buttonsVisible = ViewONE.isAllButtons(); Returns a Boolean value of ‘true’ if the all buttons are visible else a value ‘false’ is returned (these are file, print, image, new-window and view buttons) Method: setPageButtons(true/false) E.g. ViewONE.setPageButtons(true); Specifies whether the toolbar includes page buttons. A value of ‘true’ (default) indicates the buttons are visible and ‘false’ indicates they are not.
-
Method: toggleAdjustTool() (V3-Only) E.g. ViewONE.toggleAdjustTool(); This method toggles the visibility of the adjust tool (brightness/contrast/luminance). Method: setAdjustToolVisible(OnOff) (V3-Only) E.g. ViewONE.setAdjustToolVisible(True); This method sets the visibility of the adjust tool (brightness/contrast/luminance). Method: isAdjustToolVisible() (V3-Only) E.g. var onOff = ViewONE.
-
Menus and keys Method: setFileMenus(true/false) E.g. ViewONE.setFileMenus(true); Specifies whether the file pop-up menus are available (using mouse button 2/3). A value of ‘true’ (default) indicates the menus are available and ‘false’ indicates they are not. The menu is as follows: Security note: This method is disabled by default unless the “JavascriptExtensions” parameter is set to “true”. Method: IsFileMenus() E.g. var menusEnabled = ViewONE.
-
Method: setViewMenus(true/false) E.g. ViewONE.setViewMenus(true); Specifies whether the view pop-up menus are available (using mouse button 2/3). A value of ‘true’ (default) indicates the menus are available and ‘false’ indicates they are not. The menu is as follows: Method: isViewMenus() E.g. var menusEnabled = ViewONE.isViewMenus(); Returns a Boolean value of ‘true’ if the menus are enabled else a value ‘false’ is returned.
-
Method: setImageMenus(true/false) E.g. ViewONE.setImageMenus(true); Specifies whether the image pop-up menus are available (using mouse button 2/3). A value of ‘true’ (default) indicates the menus are available and ‘false’ indicates they are not. The menu is as follows: Method: isImageMenus() E.g. var menusEnabled = ViewONE.isImageMenus(); Returns a Boolean value of ‘true’ if the menus are enabled else a value ‘false’ is returned.
-
Method: setPrintMenus(true/false) E.g. ViewONE.setPrintMenus(true); Specifies whether the print pop-up menus are available (using mouse button 2/3). A value of ‘true’ (default) indicates the menus are available and ‘false’ indicates they are 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.
-
Method: setPageMenus(true/false) E.g. ViewONE.setPageMenus(true); Specifies whether the page pop-up menus are available (using mouse button 2/3). A value of ‘true’ (default) indicates the menus are available and ‘false’ indicates they are not. The menu is as follows: Method: isPageMenus() E.g. var menusEnabled = ViewONE.isPageMenus(); Returns a Boolean value of ‘true’ if the menus are enabled else a value ‘false’ is returned.
-
Method: setSelectMenus(true/false) E.g. ViewONE.setSelectMenus(true); Specifies whether the select pop-up menus are available (using mouse button 2/3). A value of ‘true’ (default) indicates the menus are available and ‘false’ indicates they are not. The menu is as follows: Method: isSelectMenus() E.g. var menusEnabled = ViewONE.isSelectMenus(); Returns a Boolean value of ‘true’ if the menus are enabled else a value ‘false’ is returned.
-
Method: setPreferenceMenus(true/false) E.g. ViewONE.setPreferenceMenus(true); Specifies whether the preference pop-up menus are available (using mouse button 2/3). A value of ‘true’ (default) indicates the menus are available and ‘false’ indicates they are not. The menu is as follows: Method: isPreferenceMenus() E.g. var menusEnabled = ViewONE.isPreferenceMenus(); Returns a Boolean value of ‘true’ if the menus are enabled else a value ‘false’ is returned.
-
Method: setAllMenus(true/false) E.g. ViewONE.setAllMenus(true); Specifies whether the all pop-up menus are available. A value of ‘true’ (default) indicates the menus are available and ‘false’ indicates they are not. Security note: This method is disabled by default unless the “JavascriptExtensions” parameter is set to “true”. Method: isAllMenus() E.g. var menusEnabled = ViewONE.isAllMenus(); Returns a Boolean value of ‘true’ if the menus are enabled else a value ‘false’ is returned.
-
Method: setImageKeys(true/false) E.g. ViewONE.setImageKeys(true); Specifies whether the hot keys for image operations are enabled. A value of ‘true’ (default) indicates the keys are enabled and ‘false’ indicates they are not. The keys are as follows: Fit to window width Fit to window height Fit to window Zoom in Zoom out Magnifier Zoom to 100% Zoom area Rotate clockwise Rotate counterclockwise Enhance Invert Method: F9 F10 F11 Add Subtract M Z A R L E I isImageKeys() E.g. var keysEnabled = ViewONE.
-
Method: setPrintKeys(true/false) E.g. ViewONE.setPrintKeys(true); Specifies whether the hot keys for print operations are enabled. A value of ‘true’ (default) indicates the keys are enabled and ‘false’ indicates they are not. The keys are as follows: Print page Print document Print page range Print selected pages P Shift-P Ctrl-P Ctrl-Shift-P Security note: This method is disabled by default unless the “JavascriptExtensions” parameter is set to “true”. Method: isPrintKeys() E.g.
-
Method: isViewKeys() E.g. var keysEnabled = ViewONE.isViewKeys (); Returns a Boolean value of ‘true’ if the keys are enabled else a value ‘false’ is returned. Method: setPageKeys(true/false) E.g. ViewONE.setPageKeys(true); Specifies whether the hot keys for page operations are enabled. A value of ‘true’ (default) indicates the keys are enabled and ‘false’ indicates they are not. The keys are as follows: Next page Previous page First page Last page Method: Page Down Page Up Home End isPageKeys() E.g.
-
Method: isSelectKeys() E.g. var keysEnabled = ViewONE.isSelectKeys (); Returns a Boolean value of ‘true’ if the keys are enabled else a value ‘false’ is returned. Method: setAllKeys(true/false) E.g. ViewONE.setAllKeys(true); Specifies whether the all hot keys are enabled or not. A value of ‘true’ (default) indicates the keys are enabled and ‘false’ indicates they are not. Security note: This method is disabled by default unless the “JavascriptExtensions” parameter is set to “true”.
-
Timeout/User Idle Control Method: setTimeout(seconds) E.g. var ready = ViewONE.setTimeout(30); This method sets and starts a usage timer. If the user does not use the applet for the number of seconds specified then the applet will automatically be disabled. It can be reenabled by calling one of the timeout JavaScript methods (see below), opening a document using one of the JavaScript open methods, by revisiting the page containing the applet (Netscape) or reloading the page (Internet Explorer).
-
Method: getTimeLeft() E.g. var timeleft = ViewONE.getTimeLeft(); This method returns the time in seconds left before the applet times-out. but only 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 automatically reset each time the user performs any action, such as scrolling, changing pages, zooming etc. Method: wakeUp() E.g. ViewONE.
-
The Event Handler and Event Handling ViewONE introduces the concept of applet JavaScript event handling. This is a mechanism by which it is possible to use JavaScript to monitor user activity and other selected actions performed by the ViewONE applet. This can be a powerful facility, for example, it allows user activity and usage to be logged and/or actions to be performed dependent on what the user is doing/has done (e.g.
-
Events handler change in ViewONE Version 3 Prior to ViewONE Version 3, all events were signaled irrespective of whether the event was required. However, Version 3 introduced an event filter so that only those events that are desired are signaled to the event handler. Version 3 requires an additional HTML parameter which 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 parameter takes the form of a simple list, e.
-
Events ids and descriptions 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.
-
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.
-
- Windows main menu key - Popup menu key The following keys will generate events but will always also be handled by 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 Descriptio “A” A key pressed Control A Ctrl + A keys pressed Shift A Shift + A keys pressed Alt A Alt + A keys pressed Alt Shift Control A Alt Shift + Ctrl + A keys pressed Space
-
Event Handler example:
ViewONE Event Handler Demo