CADViewer HTML Applet Parameters

Using CADViewer Parameters

There are two methods to set up the parameter control in CADViewer. The first method is to add a < param > tag within the < applet ...> and </applet> tag that is embedded into the html file which launch the viewer. For example: < param name="defaultlanguage" value="english">.

There are two applet parameters that are always required to make CADViewer run, these are the name of the initial file to be loaded in and the name of the configuration file.

The configuration file can have an optional extension, typically is used .cfg or the more neutral .txt if the installed server does not have .cfg defined as a mime-type. < param=configfile value=viewer.cfg"> or < param=configfile value=viewer.txt">

When the configuation file is defined, a parameter definition can be added to the configuration file:defaultlanguage=english

NOTE: If a parameter is defined in both formats, the < applet > ... </applet> tag definition will overwrite the configuration file.

Required HTML Parameters - File Name and Configuration File

HTML
Value/Description
Default
Config File
<param name="name" value="./demo.html">
"./drawing.dwf", Drawing URL
none
none
<param name="config_file" value="viewer.cfg>
"./viewer.txt", config file URL
viewer.cfg
none
<param name="configfile" value="viewer.cfg>
"./viewer.txt", config file URL
viewer.cfg
none

License Key

HTML
Value/Description
Default
Config File
<param name="licensekeyfile" value="license.key">
Rename the license.key file to a preferred name, such as "license.key"
license.key
licensekeyfile=license.key
<param name="licensekeylocation" value="../any/web/folder">
Set the path where the license.key/license.txt file is located if different from codebase
codebase
licensekeylocation=../any/web/folder

Debug Logging

HTML
Value/Description
Default
Config File
<param name="debug" value="enable">
"enable","disable": "enable" will print out debug info to java console
disabled
debug=enable

Functional Callback

HTML
Value/Description
Default
Config File
<param name="onloadend" value="CADViewerLoadEnd">
Method name for JavaScript call. When CADViewer is fully running, and drawing "name" has been loaded up, CADViewer will call the JavaScript method function defined by this parameter, for example CADViewerLoadEnd(){}.This call is typcially used to set up CADViewer initalization via API, see CADViewer Java/JavaScript API.
none
none

Toolbar Controls

HTML
Value/Description
Default
Config File
<param name="upper_toolbar" value="disable">
diable/enable , hide the CADViewer toolbar for external API interaction.
enable
upper_toolbar=disable
<param name="redlinetool" value="vertical">
vertical, enables the redline toolbar permanently and displayed vertically on the left
horizontal
redlinetool=vertical
<param name="floatsubtoolbar" value="enable">
enable, have the sub toolbars displayed as separate frames
disabled
floatsubtoolbar=enable
<param name="disable_redline_toolbaricons" value="enable">
enable, do not show redline toolbar (for read-only redlines).
not disabled
none

Viewer Display and Hyperlink Control Parameters

HTML
Value/Description
Default
Config File
<param name="type" value="panel">
"panel","frame" , frame: separate frame, panel: embedded to browser
panel
type=panel
<param name="target" value="_blank">
"_blank","_self","_new", To open a link in the drawing with the current browser window or new browser instance
_blank
target=_blank
<param name="url_target" value="_blank">
"_blank","_self","_new", To open a link in the drawing with the current browser window or new browser instance
_blank
url_target=_blank
<param name="supress_load_error_messages" value="enable>
All error and info messages during load is disabled
none
none
<param name="URLClick" value="single">
Defines interaction with the canvas as a single mouse click. Default is double click. Works for hyperlinks and editable redline sticky notes.
double
none
<param name="tooltipoff" value="enable">
Disables all tooltips on hyperlinks
tooltip enabled
none
<param name="image_path" value="myimage_path/">
To define a folder for user defined icons to CADViewer.The path "myimage_path" defines a subpath to the /cadviewer codebase path
images
none
<param name="menubackgroundcolor" value="#004B8D">
Defines the background RGB color for the icon menus.
standard CADViewer grey
none

Viewer Canvas Control Parameters

HTML
Value/Description
Default
Config File
<param name="zoomextents_onload" value="enable">
Force automatic Zoom to Extents on load
Initial View
none
<param name="initial_view_name" value="Entire Building">
"Entire Building" named view will be displayed when the drawing is loaded
none
initial_view_name=Entired Building
<param name="background_color value="green">
Viewer background color, any Java defined standard color.
white
background_color=white
<param name="init_blackonwhite" value="enable">
Display drawing black on white as the default
none
none
<param name="fillmode" value="off">
Turn fillmode of polygons off
none
fillmode=off
<param name="left_justified" value="enable>
Set the drawing to be left justified.Available values="enable","disable".rawing is normally displayed on the center of the applet panel.
diabled
left_justified=enable
<param name="water_mark" value="Hello World!">
Customer watermark to be displayed on the canvas.
none
water_mark="Hello World!"
<param name="watermarkcolor" value="red">
Watermark color, any Java defined standard color
none
watermarkcolor=red
<param name="watermarklocation" value="middle">
"top","middle","bottom": Sets the location for the watermark text
middle
watermarklocation=middle
<param name="watermarksize" value="30">
Any integer value: Sets the size for the watermark text in pixels
30
watermarksize=30
<param name="watermarklocation_percentage" value="15">
An interger value between 0 and 100: Sets the location for the watermark text, measured from the top of the canvas in percentage.
none
none

File Conversion and Load - Control of Server Side Modules

HTML
Value/Description
Default
Config File
<param name="conversionURL" value="http://67.112.1.1:8080/servlet/ConversionServlet">
Names the Servlet, Perl Script or customer defined techonlogy on the server that records CADViewers request for a non-DWF files. CADViewer sends requests to convert non-dwf files to dwf files, the server side will respond with a stream containing the dwf file for display, see Conversion Installation Docs.
none
conversionurl="http://myscript.pl"
<param name="input_file_on_server" value="enable">
In a typical flow, CADViewer will load up the DWG(or other complex file format) and send it to the location of the conversionURL. If the input file resides on the same server as the conversion tool, enabling this parameter will save the roundtrip.
none
none
<param name="conversionparameters" value="-vn=*ALL* -ver=6">
Add custom parameters to the server side CAD conversion engine, see the conversion parameter interface for the Tailor Made conversion engines.
none
none
<param name="conversiondwfsave" value="myfile.dwf"
Leave a copy of temporary DWF file on server with name myfile.dwf
none
none
<param name="conversionnondwfsave" value="enable"
Leave a copy of the non-DWF file in the temporary directory on server
none
none
<param name="model_paper_space" value="enable"
Requst a multipage DWF with model and paperspace. NOTE: Redundant, use <param name="conversionparameters" value="-vn=*ALL* -ver=6">
none
none
<param name="usefullconversionpathnames" value="enable"
Do not allow any internal pasrsing of path names.
none
none
<param name="donotencodeconversionpathnames" value="enable"
Do not encode any characters in path names, pass over to server as is.
none
none
<param name="drawingserverport" value="8080"
Manually set the server port name for loading of drawings.
none
none
<param name="multiplepages" value="staged"
For very large multipage DWG files, CADViewer can make the conversion staged. The implication of this is that the multipage file is converted into a batch of single page files on the server. CADViewer will keep the bookkeeping of pages internally. On the client, speed is increased and memory and bandwidth usage goes down.
staged
none
<param name="multiplepageslocation" value="value="http://myserver/converter/tempdirectory"
The URL to the location of the staged files, this will typically be the temporary conversion directory associated with the Conversion Module
Name of conversion directory
none

File Compare - Visualize difference between two files

HTML
Value/Description
Default
Config File
< param name="compare_one_file_urlpath" value="../any/web/folder/name.dwf">
Defines the second file to perform a file comparison
none, if undefined file is loaded in via the file load icon
none
<param name="comparefirstfilecolor" value="red">
Specify the color on the first compare/overlay file, value is any Java standard color
red
none
<param name="comparesecondfilecolor" value="blue">
Specify the color on the second compare/overlay file, value is any Java standard color
blue
none
<param name="compare_file_path" value="../any/web/folder/">
Defines a server side path to use servlet to browse files to compare with
none, if undefined file is loaded in via the file load icon
none
<param name="compare_file_path_extension" value="dwf">
Optionally defines a server side extension to use servlet to browse files to compare with
dwf
none

Open/Save Drawing Files Parameters

HTML
Value/Description
Default
Config File
<param name="initialdrawinglocation" value="value="local"
If running under a local host (localhost), sets up file names to be concatenated with current host name and location.
none
none
<param name="overlayfilename" value="value="http://myserver/myfile.dwf"
Name of the second (overlay) file that needs to be loaded into the canvas. Typical use cases are overlaying drawings on a bitmap wall paper, or when using the extended redlines Sticky nonetes interface to add Sticky nonetes onto a drawing.
none
none
<param name="save_with_API_modifications" value="enable">
When DWF file is saved, any modification to the original file, either through API or method calls will be saved through CADViewer parser.
Original DWF is retained
none
<param name="list" value="../../anyfolder/drawinglist.txt">
"drawinglist.txt" lists drawing to be viewed by users. Allow users to view selected drawings on the server
"drawing.txt" in the codebase folder
list=../../anyfolder/drawinglist.txt
<param name="saveas" value="*.dwf">
"save.dwf" is the name of the file to be saved. Allow users to save the drawing on the server or local machine
Default
saveas=save.dwf
<param name="openfilelocation" value="local">
"local","local&server","server": Allows drawings to be to opened from local machine, server or both
local
openfilelocation=local
<param name="save_drawing_to_url" value="http://www.xyz.com/servlets/FileUploadServlet">
The URL of the script used to save drawing to server: Use this parameter to determine the URL of the script/servlet used to save the drawing to the server
none
save_drawing_to_url=http://www.xyz.com/servlets/FileUploadServlet
<param name="save_drawing_to_url" value="http://www.xyz.com/cgi-bin/yourscript.cgi?p1=v1&p2=v2&p3=v3&.....&pn=">
CADViewer will post the request to server and fill out the last parameter value. CADViewer will send the request to the server and it will fill the last parameter with the drawing content. If value="http://www.xyz.com/cgi-bin/yourscript.cgi", then CADViewer will send 2 parameter: 1) saveLocation value=the value of the parameter "save_drawing_file_path" 2) redlinesdwf value=the content of the drawing or the drawing+redline
none
save_drawing_to_url=http://www.xyz.com/cgi-bin/yourscript.cgi?p1=v1&p2=v2&p3=v3&.....&pn=
<param name="save_drawing_file_path" value="./drawings/demo.dwf">
The relative path to the location that the drawing should be saved relative to codebase.
none
save_drawing_file_path=./drawings/demo.dwf

Open/Save Redline Files Parameters

HTML
Value/Description
Default
Config File
<param name="save_redline_to_url" value="./cgi/redsaver.cgi">
Names the Servlet, Perl Script or customer defined techonlogy on the server that saves CADViewers redline files, see Redline Docs.
none
save_redline_to_url=./servlets/Redsaver.class
<param name="save_redline_file_to_url" value="/redlines/test.red">
Name and path of file to be saved through parameter "save_redline_to_url"
If save_redline_file_to_url is undefined, "redline_file" or "redline_file_path" will be used.
save_redline_file_to_url=/redlines/test.red
<param name="redlineparams" value="my parameters">
Custom parameter string to be sent to "save_redline_to_url" as part of save redline call
none
none
<param name="redlinelocation" value="local">
"local","server","local&server": Determines the location to open redline files.
local
redlinelocation=local
<param name="save_redline_method" value="local">
"local","server","local&server":Determine the location to Save Redline files.
local
save_redline_method=local
<param name="save_redline_directory" value="c:\temp">
The path on the local machine where redline files will be saved.This parameter is used for save redline locally when user interaction is not allowed.
none
save_redline_directory=c:\temp
<param name="save_redline_filename" value="demo.red">
This parameter is used for save redline locally when user interaction is not allowed.
none
save_redline_filename=demo.red
<param name="save_redline_in_drawing_as" value="my_redline_layer">
This parameter is used for save redline objects on a named layer in the drawing.
none
save_redline_in_drawing_as=redlines
<param name="list_redline_files" value="*.red">
"*.red","*.red;*.dwf","extensions". This parameter is used to show certain type of redline files to open. "extensions" will display all redline file types available in CADViewer.
*.red
list_redline_files=*.red
<param name="redline_cgi" value="./cgi/redsaver.cgi">
The URL of the cgi script or Servlet file in case dialogue box on server is active
none
redline_cgi=./cgi/redsaver.cgi
<param name="open_redline_with_drawing" value="initial">
"initial", "always": Open a specified redline file either at the time the drawing is loaded or all the time whenever "open redline file" button is clicked.This parameter is used with either "load_redline_from_url" or "open_redline_from_url" to control how redline files are opened.
none
open_redline_with_drawing=initial
<open_redline_from_url" value="/redlines/test.red>
"test.red" redline file will be opened when user click on the "open redline file" button.This will only allow user to view this redline file only.
none
open_redline_from_url=/redlines/test.red
<param name="load_redline_from_url" value="/redlines/test.red">
The file "test.red" redline file will be opened either intially or always depending on the value of the parameter "open_redline_with_drawing"
none
load_redline_from_url=/redlines/test.red
<name="open_redline_list_script" value="http://www.xyz.com/cgi-bin/redlineScript.cgi">
The name of the script that will provide CADViewer with a list of reline file names. When CADViewer communicates with the script, this script will provide cadviewer with the URL of the redline file and the short name for the file. Example: http://www.xyz.com/redlines/redlineA.red A.red
none
open_redline_list_script=http://www.xyz.com/cgi-bin/redlineScript.cgi
<param name="preload_readonly_redline" value="http://www.xyz.com/redlinefolder/demo.red">
Load the redline with the drawing and does not allow to save these redlines. Can load more than one read-only redline files. File names are separated by ";"
none
preload_readonly_redline=http://www.xyz.com/redlinefolder/demo.red
<param name="redline_file_path" value="/redlines/test.red">
The redline file name and location to be saved.
This parameter can also be used when browsing directories at redline file load, in this case only enter the path to the directory. The parameter list_redline_files controls which files extensions are listed.
none
redline_file_path=/redlines/test.red or
redline_file_path=http://mydir/redlines/
<param name="redline_file" value="test.red">
The redline file name to be saved.
none
redline_file=test.red
<param name="keep_existing_redlines_on_load" value="enable">
Keep existing redlines active when loading subsequent redline(s).As default CADViewer will clear all existing redlines when loading in a redline.
none
none
<param name="open_redline_with_drawing" value="multiple">

<param name="xopen_redline_from_url" value="url=../redlines/;files=test12.red,test1.red;url=../;files=test123.red">
Loads in multiple drawings, syntax is a pair of (url= and files=) separated with ';' files= can have multiple files, separated with ',': url=xxx;files=yy,zz;url=aaa;files=bb;
<param name="open_redline_from_url" value="url=http://localhost:8080/aprotestdir/redlines/;files=test12.red,test1.red;url=http://localhost:8080/aprotestdir/;files=test123.red">
none
none

Redline Parameters

HTML
Value/Description
Default
Config File
<param name="polylinearrow" value="last">
"last","first": Use this parameter to determine whether the arrow should be put at the first point or the last point on the polyline arrow redline object
first"
polylinearrow=last
<param name="redlinecolors" value="disable">
Use this parameter to hide the color selection in redline toolbar.
enable
redlinecolors=disable
<param name="default_redline_color" value="red">
"black","white","blue","yellow","red","gray","dark gray","light gray","green","magenta","orange","pink": Use this parameter to determine set the default redline color when the color selection in the redline toolbar is hidden
red
default_redline_color=red
<param name="redlinethickness" value="10">
To set the line thickness for redline objects.If this parameter is not defined, the line thickness is assigned to 1
1
redlinethickness=10
<param name="tenredlinecolors" value="enable">
Vaule is "enable". Parameter limits the number of colors in the redline toolbar to 10 colors.
none
none
<param name="select_drawing_entities" value="enable">
Vaule is "enable". When selecting objects, enables a choice between Redlines, Redlines and Drawing Entities, Draving Entities or Redline Text
none
none
<param name="select_redline_text_entities" value="enable">
Vaule is "enable". When selecting objects, enables a choice between Redlines or Redline Text
none
none

Redline Sticky Notes Parameters

HTML
Value/Description
Default
Config File
<param name="stickynote_file_name" value="S1__2.dwf">
File name of .dwf overlay file with sticky notes.
none
none
<name="save_stickynote_to_url" value="http://www.myserver.com/cadviewer/cvredsaver_SN.cgi">
Names the Servlet, Perl Script or customer defined techonlogy on the server that saves CADViewers redline sticky notes files
none
none
<name="stickynote_bitmap_file_path" value="N://Webroot//somepath//Files//Redlines//21.png">
Parameter which content is sent to as part of save_stickynote_to_url call.
none
none
<name="stickynote_asset_id" value="Cormack-11-x3">
Custom Id for Stickynot
""
none
<name="stickynote_user_id" value="FR002-12">
Custom Id for Stickynot
""
none
<name="stickynote_user_name" value="Dave Blair">
User name, displayed on top of Sticky Note when expanded.
""
none
<name="stickynotes_line_width" value="44">
Width of the sticky note box in characters.
38
none
<name="stickynotes_line_width_bufffer" value="8">
Width buffer of the sticky note box in percentage
10
none
<param name="redboxlineweight" value="3">
Sets the line weight of the red arrow box.
0
none
<param name="tenredlinecolors" value="enable">
enable : limits the number of colors in the redline toolbar to 10 colors.
none
none

Printing

HTML
Value/Description
Default
Config File
<param name="printbackgroundcolor" value="enable">
"enable","disable": Use this parameter to print the current background color. The default is to print on white background<
"disable"
printbackgroundcolor=enable
<param name="printredlines" value="disable">
"enable","disable": Set whether to print redline objects with the drawing. This parameter is used when user interaction is disabled by parameter "printdialog"
"enable"
printredlines=disable
<param name="print_watermark" value="enable">
Adds the watermark to the print output.
disable
none
<param name="printblackwhite" value="enable">
"enable","disable": Set printing output to black and white
"disable"
printblackwhite=enable
<param name="printdialog" value="disable">
"enable","disable": Set whether to allow user interactions when drawing is printed
"enable"
printdialog=disable
<param name="print_insertionpoint" value="enable">
"enable","disable": CV normally prints what is displayed on screen. This parameter gives user a choice to select insertoinpoint on what to print
"disable"
print_insertionpoint=enable
<param name="printjsapi" value="enable">
Enables direct printing through the JavaScript API using the method PrintJsApi(), see CADViewer Java/JavaScript API
disable
none
<param name="printorientation" value="landscape">
Sets the default print oritentation to either landscape or portrait
portrait
none

Collaborator

HTML
Value/Description
Default
Config File
<param name="collaboratorURL" value="http://67.112.1.1:8080/collaborator/servlet/CollaboratorServlet">
This parameter enables CADViewer to send requests to the collaborator servlet that monitors the collaborator
none
collaboratorURL=http://67.112.1.1:8080/collaborator/servlet/CollaboratorServlet
<param name="collaborator_username" value="userName">
"collaborator_username" parameter is optional and if this is used, CADViewer will list the active sessions from the server and CADViewer sets the user name using the value of this parameter rather than have the username typed in by the user
none
none

Measurement Tool

HTML
Value/Description
Default
Config File
<param name="userscale" value="0.5">
Multiply the linear measurement by this scale. This parameter is used to correct the scale defined within the drawing. For example, if the unit in the drawing is in "in" but the actuall unit is in "ft", then scale should set to 1/12=.0833333
none
userscale=0.5
<param name="unitnamescale" value="in,0.005">
Define the units for the drawing.If there is no drawing units defined in the drawing, this parameter can be used to set the units for the drawing
none
unitnamescale=in,0.005
<param name="setunitsname" value="in">
"in", "ft","cm", "mm", "m","null": Defines the units name for the drawing.If the value is "null", CADViewer will ignore the units defined in the drawing and treats the drawing as no units defined
none
setunitsname=in

Miscellaneous

HTML
Value/Description
Default
Config File
<param name="defaultlanguage" value="english">
Sets the default language in CADViewer. The available languages are defined in the configuration file, in the current version portuguese, english and chinese-simplified is supported.
english
defaultlanguage=english
<param name="local_help" value="http://www.xyz.com/viewer/help.html">
URL to the help file or a call to a javascript function.Example: http://www.xyz.com/viewer/help.html or javascript:localhelp (this will execute the javascript localhelp()
none
local_help=http://www.xyz.com/viewer/help.html
<param name="on_layers" value="l1;l2;l3">
Layers l1,l2 and l3 will be displayed. Lists which layers will be displayed initally
Displays all layers
on_layers=l1;l2;l3
<param name="off_layers" value="l1;l2;l3">
Layers l1,l2 and l3 will be hidden. Lists which layers to be hidden initally
Displays all layers
off_layers=l1;l2;l3
<param name="hideobjectsize" value="3">
The max size of the object in pixels. Do not draw objects that the size is smaller than the size defined in "hideobjectsize" parameter.
none
hideobjectsize=3
<param name="forcechoiceoffont" value="SansSerif">
Force displays of a Java defined font on the drawing
Default
forcechoiceoffont=SansSerif
<param name="FillAllPolylinesOnLayer_ImagesToFront" value="enable">
When using API call FillAllPolylinesOnLayer(), images are moved to the front of file, thereby appearing below filled objects.
none
none
<param name="nourlfocuscallbackmethod" value="ClickCallBack">
When mouse is clicked and there is no url/hyperlink action taking place, the callback method named by nourlfocuscallbackmethod is executed via the API.
none
none

Popup Menu Parameters

HTML
Value/Description
Default
Config File
nonet Available
Adds ZoomIn action to the popup menu
zoomin
popupmenu=zoomin
nonet Available
Adds ZoomOut action to the popup menu
zoomout
popupmenu=zoomout
nonet Available
Adds ZoomWindow action to the popup menu
zoomwindow
popupmenu=zoomwindow
nonet Available
Adds ZoomExtents action to the popup menu
zoomextents
popupmenu=zoomextents
nonet Available
Adds Pan action to the popup menu
pan
popupmenu=pan
nonet Available
Adds Print action to the popup menu
print
popupmenu=print
nonet Available
Adds Layers action to the popup menu
layers
popupmenu=layers
nonet Available
Adds a Separator to the popup menu
separator
popupmenu=separator