JAVA Tech VERSION 3.0 manual Opening documents and images, OpenFilefilename, CloseDocument

Page 19

Method:

Method:

Method Group:

Opening documents and images

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

closeDocument()

E.g. ViewONE.closeDocument();

Closes an open document.

NOTE: Closing the open document also resets annotations, annotation templates and background images.

initializePageArray(numPages) setPageArray(filename, page) openPageArray(page)

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 page of the document), then opens the ‘assembled’ document at page 1. Note the page array begins at array element zero.

19

Image 19
Contents ViewONE JavaScript API Manual Contents Specifying an Annotations File Viewing Toolbars and Buttons Timeout/User Idle Control Introduction Applet user interface ViewONE Standard Installing ViewONEMayscript parameter ViewONE ProApple Macintosh users JavaScript Apple Macintosh users Html Using ViewONE Standard on IE for Apple MacintoshSetting up Windows 2003 server Page Page ViewONE JavaScript Overview JavaScript Reference Method isReady General Applet ControlMethod getVersion ViewONE.closeDocument Closes an open document Opening documents and imagesOpenFilefilename, CloseDocumentPage Method Group Method openListlistFile, MethodgetNumPages ReloadListOpenDocindex NextDoc PrevDoc FirstDoc LastDoc GetDocIndex GetNumDocsMethod previousPage MethodsetPagepageMethod getPage Method nextPageMethod getCacheFile MethodgetDocReferenceMethodsetAnnotationFilefilename Specifying an Annotations FileMethodsaveSelectedfilename Saving documents and imagesSavefilename SavePagefilenameMethodisMultipageTif SetHyperlinkurl, dblClick Document hyperlinksClearHyperlink Method Pro-Only Method Pro-Only Method Cold Viewing Options Pro-Only SetBackgroundImagefilename, pageNumber IsBackgroundImageEnabled SetBackgroundImageEnabledtrue/falseSetIndexListFileURL Document Indexes Pro-OnlyIsInverted ImageInvert SetInvertedtrue/falseSetRotationangle IsEnhancetrue/falseSetEnhanceModemode GetEnhanceModeMethod getRotation Method initializeRotationArrayint sizeMethod setRotationArrayint angle, int Method applyRotationArraySetFlipmode MethodrotateClockwiseMethod rotateCounterclockwise Rotate180GetStates GetFlipSetScalescale GetScaleMethod zoom100 ViewONE.zoom100 Zooms image to 100% full resolutionMethod setStatesstring states Method zoomOutSetXYScrollx, y Method setZoomzoomMethod setZoomAndXYScrollzoom, x, y Method zoomAreax, y, width, height, highlight, secondsMethod setBrightnesspercent Method setDraggingEnabledtrue/falseMethod isDraggingEnabled Method resetBrightnessMethod getContrast Method resetContrastMethod getBrightness Method setContrastpercentMethod getImageWidth Method resetLuminanceMethod setLuminancepercent Method getLuminanceMethod getYResolution Method getXResolutionGetImageHeight SetViewview ViewingGetView Method setMagnifiertrue/false SetAreaZoomtrue/falseIsAreaZoom ToggleAreaZoomMethod setMagnifierInternaltrue/false Method getMagFactor IsMagnifierToggleMagnifier SetMagFactorSetImageForeColorcolor IsNewWindowVisibleShowImageForeColorDialog ShowImageBackColorDialog SetImageBackColorcolorLabels Method copyPageToClipboard Selection and clipboardMethod selectPageint pageNumber Method clearSelectionsPrintRange PrintingPrintPage PrintDocumentSetPrintDialogtrue/false PrintSelectedPrintVisible PrintTransformedMethod setPrintCopiesinteger Method isPrintDialogMethod setPrinterstring Or some other informational text Method setPrintHeaderheaderStringMethod setPrintAutoRotate true/false SetStatusBartrue/false Toolbars and ButtonsMethod setScrollbarstrue/false IsScrollbarsMethod isFileButtons Method setFileButtonstrue/falseIsImageButtons Method setImageButtonstrue/falseSetPrintButtonstrue/false Method setNewWindowButtonstrue/false Method isPrintButtonsSetInvertButtonstrue/false IsInvertButtonsMethod setAllButtonstrue/false IsNewWindowButtonsSetViewButtonstrue/false Method isViewButtonsMethodsetPageButtonstrue/false Method isAllButtonsMethod isPageButtons SetAdjustToolVisibleOnOff ToggleAdjustToolIsAdjustToolVisible ViewONE.setFileMenustrue Menus and keysSetFileMenustrue/false IsFileMenusIsViewMenus SetViewMenustrue/falseViewONE.setViewMenustrue IsImageMenus SetImageMenustrue/falseViewONE.setImageMenustrue IsPrintMenus SetPrintMenustrue/falseViewONE.setPrintMenustrue IsPageMenus SetPageMenustrue/falseViewONE.setPageMenustrue IsSelectMenus SetSelectMenustrue/falseViewONE.setSelectMenustrue IsPreferenceMenus SetPreferenceMenustrue/falseViewONE.setPreferenceMenustrue IsFileKeys SetAllMenustrue/falseIsAllMenus SetFileKeystrue/falseIsImageKeys SetImageKeystrue/falseIsPrintKeys SetPrintKeystrue/falseSetViewKeystrue/false SetSelectKeystrue/false IsViewKeysSetPageKeystrue/false IsPageKeysMethod setAllKeystrue/false Method isSelectKeysMethod isAllKeys Method stopTimeout Timeout/User Idle ControlMethod setTimeoutseconds Method getTimeoutMethod getTimeLeft Event Handler and Event Handling Events handler change in ViewONE Version DocN Html tag is used see Html manual End tab Events ids and descriptionsReady First time the page is viewed HSPACE=0 VSPACE=0 Event Handler exampleMayScript tag Testing your Event Handler