ViewONE JavaScript API Manual Version 3.0 Last Updated: 04th May 2005 Copyright Daeja Image Systems. All Rights Reserv
10101010ViewONE Pro If you have downloaded ViewONE Pro (with or without the Print Accelerator, Annotations, DjVu, PDF or other optional modules), t
11111111 Apple Macintosh users (HTML) ViewONE comes with a digital certificate which is required to permit the applet to print and provide local c
12121212 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 si
13131313Click on the properties menu to display the properties dialog… Click on the MIME Type button to display the MIME Type dialog… Use t
14141414 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
15151515 ViewONE JavaScript Overview The ViewONE Javascript API offers an alternative mechanism to configure and control the ViewONE applet. In man
16161616JavaScript Reference The JavaScript examples in this manual do not refer to their use in any particular context. The examples could be used
17171717 General Applet Control isReady() E.g. var ready = ViewONE.isReady(); This method returns true if the applet as completed initialization.
18181818 var appletReady = false;var doc = parent.frames.main.document; //(or just 'document' if it'snot in a frame)if (doc.ViewONE
19191919 Opening documents and images openFile(filename, page) E.g. ViewONE.openFile(“myimages.tif”, 1); Specifies the filename and initial page o
DAEJA IMAGE SYSTEMS Contents Introduction...
20202020Initializing the page and thumb arrays causes a ‘soft’ close to be performed, i.e. the current document is closed and the annotation source,
21212121 initializePageAndThumbsArray(numPages) setPageArray(filename, page) setThumbsArray(filename, page) openPageArray(page) E.g. ViewONE.initi
22222222 initializeDocumentArray(numDocs) setDocumentArray(filename, index) openDocumentArray() E.g. ViewONE.initializeDocumentArray(3); ViewONE.s
23232323 reloadList() E.g. ViewONE.reloadList() This method forces the list used with the openList() method to be reloaded and the document to be r
24242424 setPage(page) E.g. ViewONE.setPage(2); Sets the current page number (an integer). getPage() E.g. var page = ViewONE.getPage(); Returns t
25252525 getDocReference() E.g. Var ref = ViewONE.getDocReference(); Gets the document reference for the document. getCacheFile() E.g. var file
26262626Specifying an Annotations File setAnnotationFile(filename) E.g. ViewONE.setAnnotationFile(“http://mysite/myannotations.ant”); This method
27272727Saving documents and images save(filename) E.g. ViewONE.save(“c:/temp/image.tif”); Saves the current document (multi-page tiffs), or curre
28282828 isMultipageTif() E.g. vat ismulti = ViewONE.isMultipageTif(); This method is useful if you want to first check whether the current documen
29292929 Document hyperlinks setHyperlink(url, dblClick) E.g. ViewONE.setHyperlink(“newpage.html”, false); or ViewONE.setHyperlink(“http://mysite
DAEJA IMAGE SYSTEMS Specifying an Annotations File...
30303030PDF Viewing Options (Pro-Only) ViewONE Pro introduced an optional PDF module. The module comes with various optional methods as follows...
31313131getPDFResolution() E.g. var depth = ViewONE.getPDFResolution(); Returns the current resolution used when viewing PDF documents. setAutoLi
32323232The best value for you can only really be discovered by experimentation since it depends upon your documents, PC and network performance and
33333333COLD Viewing Options (Pro-Only) ViewONE Pro introduced an optional COLD module. The COLD module is responsible for implementing image mer
34343434 setBackgroundImage(filename, pageNumber) E.g. ViewONE.setBackgroundImage(“mybackimage.tif“, 1); This method is used to set the COLD backgr
35353535 setBackgroundImageEnabled(true/false) E.g. ViewONE.setBackgroundImageEnabled(false); This method is used to change the visibility of the C
36363636 Document Indexes (Pro-Only) ViewONE Version 3 introduced an option to specify a text index for multi-page documents. A text index acts as
37373737 Image invert() E.g. ViewONE.invert(); Inverts the display colors (black changes to white and visa-versa). This method is also effective
38383838isEnhance(true/false) E.g. var enhance = ViewONE.isEnhance(); Returns a Boolean ‘True’ if enhance is on, ‘False’ if it is off. setEnhanceM
39393939initializeRotationArray(int size) E.g. ViewONE.initializeRotationArray(4); Initializes the rotation array, used for setting the rotation
DAEJA IMAGE SYSTEMS zoomOut()...
40404040rotateClockwise() E.g. ViewONE.rotateClockwise(); Convenience method to increase the rotation by 90 degrees. If the document is closed wh
41414141getFlip() E.g. var angle = ViewONE.getFlip(); Returns the flip mode as an integer. setScale(scale) E.g. ViewONE.setScale(0); Specifies
42424242setStates(string states) E.g. ViewONE.setStates(states); Sets the zoom, scroll and other states to the values specified by the coded strin
43434343 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 p
44444444 setDraggingEnabled(true/false) E.g. ViewONE.setDraggingEnabled(true); Specifies whether the dragging of the image is permitted or not (us
45454545 getBrightness() E.g. var percent = ViewONE.getBrighness(); Returns the current brightness percentage setting (0-100). setContrast(percen
46464646setLuminance(percent) E.g. ViewONE.setLuminance(70); This method sets the luminance of the image displayed. The value represents a percent
47474747getImageHeight() E.g. var height = ViewONE.getImageHeight(); Returns an integer value representing the height of the currently displayed i
48484848Viewing setView(view) E.g. ViewONE.setView(0); Specifies the view mode used to display pages of a document. This method is effective only
49494949 setAreaZoom(true/false) E.g. ViewONE.setAreaZoom (true); If true, initiates the zoom-area mode. The mouse pointer changes to a cross and
DAEJA IMAGE SYSTEMS printDocument()...
50505050setMagnifierInternal(true/false) E.g. ViewONE.setMagnifierInternal(true); If true, displays a magnifier window internal to the display are
51515151 isMagnifier() E.g. var magVisible = ViewONE.isMagnifier(); Returns a Boolean value indicating the magnifier visibility status. toggleMag
52525252 isNewWindowVisible() E.g. ViewONE.setNewWindowVisible(!ViewONE.isNewWindowVisible()); Returns a Boolean value of ‘true’ if the ViewONE ne
53535353 setImageBackColor(color) E.g. ViewONE.setImageBackColor(255, 255, 255) This method sets the default color used for the background of mono
54545454 Labels initializeLabels(numLabels) setLabel(pageLabel, pageLabelColor, thumbLabel, thumbLabelColor, labelNum) useLabels() clearLabels() E
55555555 Selection and clipboard selectPage(int pageNumber) E.g. ViewONE.selectPage(4); Toggles the select property on the page in a document ind
56565656 Printing printPage() E.g. ViewONE.printPage(); Produces a print dialog to allow the user to print the current page. Security note: This
57575757printSelected() E.g. ViewONE.printSelected(); Produces a print dialog to print pages selected using the page-select menu (available for mul
58585858isPrintDialog() E.g. var dialog = ViewONE.isPrintDialog(); Returns a Boolean ‘True’ if the print dialog is enabled, ‘False’ if it is not.
59595959 setPrintHeader(headerString) E.g. ViewONE.setPrintHeader(“$page # $of ##”) Printouts can include custom text at the top of each page. By d
DAEJA IMAGE SYSTEMS isFileKeys()...
60606060 setPrintAutoRotate (true/false) E.g. ViewONE.setPrintAutoRotate(true) This parameter is only available when used with the print accelerato
61616161 Toolbars and Buttons setScrollbars(true/false) E.g. ViewONE.setScrollbars(true); Specifies whether scrollbars will appear when the image
62626262 setFileButtons(true/false) E.g. ViewONE.setFileButtons(true); Specifies whether the toolbar includes file buttons. A value of ‘true’ (d
63636363 setImageButtons(true/false) E.g. ViewONE.setImageButtons(true); Specifies whether the toolbar includes image buttons. A value of ‘true’
64646464 isPrintButtons() E.g. var buttonVisible = ViewONE.isPrintButtons(); Returns a Boolean value of ‘true’ if the print button is visible else
65656565isNewWindowButtons() E.g. var buttonVisible = ViewONE.isNewWindowButtons(); Returns a Boolean value of ‘true’ if the new-window button is
66666666isAllButtons() E.g. var buttonsVisible = ViewONE.isAllButtons(); Returns a Boolean value of ‘true’ if the all buttons are visible else a v
67676767 toggleAdjustTool() E.g. ViewONE.toggleAdjustTool(); This method toggles the visibility of the adjust tool (brightness/contrast/luminance
68686868 Menus and keys setFileMenus(true/false) E.g. ViewONE.setFileMenus(true); Specifies whether the file pop-up menus are available (using m
69696969 setViewMenus(true/false) E.g. ViewONE.setViewMenus(true); Specifies whether the view pop-up menus are available (using mouse button 2/3).
7777Introduction ViewONE is a Java applet that extends your web browser so that you can view, zoom, magnify, scroll, pan, rotate and print your ima
70707070 setImageMenus(true/false) E.g. ViewONE.setImageMenus(true); Specifies whether the image pop-up menus are available (using mouse button 2/
71717171 setPrintMenus(true/false) E.g. ViewONE.setPrintMenus(true); Specifies whether the print pop-up menus are available (using mouse button 2/
72727272 setPageMenus(true/false) E.g. ViewONE.setPageMenus(true); Specifies whether the page pop-up menus are available (using mouse button 2/3).
73737373 setSelectMenus(true/false) E.g. ViewONE.setSelectMenus(true); Specifies whether the select pop-up menus are available (using mouse button
74747474 setPreferenceMenus(true/false) E.g. ViewONE.setPreferenceMenus(true); Specifies whether the preference pop-up menus are available (using
75757575 setAllMenus(true/false) E.g. ViewONE.setAllMenus(true); Specifies whether the all pop-up menus are available. A value of ‘true’ (default
76767676 setImageKeys(true/false) E.g. ViewONE.setImageKeys(true); Specifies whether the hot keys for image operations are enabled. A value of ‘t
77777777 setPrintKeys(true/false) E.g. ViewONE.setPrintKeys(true); Specifies whether the hot keys for print operations are enabled. A value of ‘t
78787878 isViewKeys() E.g. var keysEnabled = ViewONE.isViewKeys (); Returns a Boolean value of ‘true’ if the keys are enabled else a value ‘false’
79797979 isSelectKeys() E.g. var keysEnabled = ViewONE.isSelectKeys (); Returns a Boolean value of ‘true’ if the keys are enabled else a value ‘fa
8888The Applet user interface Vertical scrollbar Horizontal scrollbar Help and progress captions appear here Enhance mode Scroll to First, Pr
80808080 Timeout/User Idle Control setTimeout(seconds) E.g. var ready = ViewONE.setTimeout(30); This method sets and starts a usage timer. If the
81818181 getTimeLeft() E.g. var timeleft = ViewONE.getTimeLeft(); This method returns the time in seconds left before the applet times-out. but on
82828282 The Event Handler and Event Handling ViewONE introduces the concept of applet JavaScript event handling. This is a mechanism by which it i
83838383Events handler change in ViewONE Version 3 Prior to ViewONE Version 3, all events were signaled irrespective of whether the event was requi
84848484Events ids and descriptions ViewONE can signal many different events to the event handler. The following list describes the events that wil
85858585event to switch focus to any alternative component on your web page. 22 ready The applet has just been started and is ready to accept Java
86868686- Windows main menu key - Popup menu key The following keys will generate events but will always also be handled by ViewONE event when Proce
87878787 Event Handler example: <html><head><title>ViewONE Event Handler Demo</title></head><body bgcolor="#C
88888888Testing your Event Handler There may be cases where ‘LiveConnect’ is not implemented (older browsers or some browser implementations on non
9999Installing ViewONE To install ViewONE on your web site you must first download the ‘Update’ zip file from the Daeja web site. This can be found
Kommentare zu diesen Handbüchern