IMPORTANT: BY USING THIS SOFTWARE YOU AGREE
TO THE ENCLOSED LICENSE. PLEASE READ THE LICENSE .
Test the viewer on your own machine |
The kit includes a demo html file and dwf file. Please open the file 'demo.html' using
your Java enabled browser. Once loaded, the viewer will start and display the demo drawing. If you get a "security exception" when running on your own machine, please try a different browser or place the viewer on a web server as described below. This message means that the browser did not allow the viewer to load the drawing from the file system. You should not see this problem when you place the viewer and demo files on a web server. If you can't see the drawing please email support@cadviewer.com for instructions. |
Installing the viewer on a web server |
copy *.class,obfu.jar,obfu.cab,help.html and *.gif to a directory on your server.
<applet codebase="URL to CADViewer" code="ViewerApplet.class" archive="obfu.jar" width=10 height=10 MAYSCRIPT> <param name="name" value="filename.dwf"> <param name="cabbase" value="obfu.cab"> </applet>
|
Setting the drawing name, format and location |
||
'name' (optional) |
If the "name" param is not used, the viewer will start and present the user with a list of drawings from the "drawings.txt" file. If you have not created such a file, you must use the name param to specify the drawing name. If the viewer is being used as a stand alone product (i.e. via the file system) the user will be presented with the open file dialog. Once a drawing is selected, the viewer will load it. The "name" param is used to specify the drawing name, the drawing format and the drawing location. The value of this param must include the file name and extension. Example: "myDrawing.dwf". Note that capitalization matters, 'mydrawing.dwf' is not the same as 'myDrawing.dwf'. The extension is used to select the drawing format. For example: <param name="name" value="drawing1.dwf"> will look for the "drawing1.dwf" file in the same directory as the HTML page. The name param may include a path from the server root. This is useful when the HTML file is not in the same directory as the drawing or when the HTML file is generated dynamically by a cgi script for example. If the drawing resides at http://www.yourcomany.com/cad/drawings/drawing1.dwf you could specify the 'name' param as <param name="name" value="/cad/drawings/drawing1.dwf"> Note the first "/" indicating that the path is relative to the root of the web server. |
|
'format' (Optional) |
Normally the drawing format is found by looking at the end of the 'name' param. For example 'drawing.dwf' will generate a DWF viewer.
<param name="format" value="dwf"> or <param name="format" value="svf"> |
|
Using the viewer inside an HTML page or as a separate window. |
||
'type' (optional) |
The CADViewer can work as part of an HTML document or as a separate window. The 'type' param is used to select this option. By default the viewer will work as a separate window. To embed the viewer in a HTML document use the value of 'panel'. <param name="type" value="panel"> Note: Make sure to set the "width" and "height" to large numbers. When the viewer is a separate window the width and height can be set to '10' so that the HTML page does not get a large empty gray spot. |
|
Specifying the location of the script for saving redlines,as well as the location of the redline files. (Pro Version Only) |
||
Users who can run scripts on their server can install a script for saving redlines. Instructions are provided later in this document. The viewer accesses a script to save the redlines to a file and loads a redline file directly from a web server directory. Optionally, both the location of the script and the location of the redlines directory can be specified. Since these parameters are specified in the HTML wrapper of a drawing, the locations of the redlines of each drawing can be unique. For example, if drawings are stored in two directories http://www.yourcompany.com/cad/drawings/buildings/ and http://www.yourcompany.com/cad/drawings/roads/ and you prefer to separate the redline files, you could use two different scripts for saving the redlines. One will save to the "buildings" directory (lets call it buildings.cgi) and another will save to the "roads" directory (roads.cgi). Lets also assume that the web server requires that all scripts be placed in http://www.yourcompany.com/cgi-bin/ You would copy the scripts to this directory. All HTML pages that contain the viewer in the "roads" directory would use the following params <param name="redline_cgi" value="/cgi-bin/roads.cgi"> <param name="redline_file" value="/cad/drawings/roads/"> While the HTML pages that use the viewer in the "buildings" directory would specify the params <param name="redline_cgi" value="/cgi-bin/buildings.cgi"> <param name="redline_file" value="/cad/drawings/buildings/"> The script will be modified to save the redlines to the correct directory as described later.
|
||
'redline_cgi' (optional) |
By default the viewer will try to access the file redsaver.cgi in the save location as
the viewer directory (where the *.class files are kept). Some systems will need to change the name of the script
or the location. For example, if the server requires that all cgi scripts reside in a cgi-bin directory. <param name="redline_cgi" value="/dwf/newsaver.cgi"> |
|
'redline_file' (optional) |
By default the viewer looks for redline files a directory "redlines" under the directory where the viewer is installed. For example, if the viewer is installed at http://www.yourcompany.com/cad/cadviewer/ The redline files would be expected to be located at http://www.yourcompany.com/cad/cadviewer/redlines/ Using this param, you can specify the location of the redline files for this drawing. The path specified must start at the root of the server ("/"). For example, if the redlines saver script saves the redline files to http://www.yourcompany.com/cad/drawings/annotations/ the param would be <param name="redline_file" value="/cad/drawings/annotations/">
IMPORTANT: The path in the redsaver.cgi to the redlines directory must point to the same location as this param. The location must be hardcoded into the script for security reasons (which is the current operation of the script) . If the script decided to save to a directory based on input from the web, there is the potential for a hacker to save files to any part of the web server. Even if this happened the damage would be limited, since the script uses a unique naming convention. |
|
Listing additional drawings that can be accessed directly |
||
'list' (Optional) |
When the user clicks on the "open" button of the viewer, the viewer will attempt to load a list of
available drawings from the server. By default the list (drawings.txt) should reside in the same directory as the
viewer. Optionally, the 'list' param can be used to specify a location for this file. For example, if the location of the drawing list is at http://www.yourcompany.com/cad/drawings/project_a/list.txt This param would be <param name="list" value="/cad/drawings/project_a/list.txt"> Note that the path is from the server root ("/"). The format of the file can be found here. |
Drawing formats (Pro Version Only) |
Version 2.0 includes support for the DWF format as well as the SVF format. To create DWF from AutoCAD DWG, download
the free AutoCAD Internet Utilities from http://www.autodesk.com
. The AIU is included in AutoCAD release 14. A commercial converter from many formats to DWF can be found at http://www.tailormade.com The viewer will select the drawing format based on the drawing name file extension. For example, drawing.dwf will invoke the DWF functionality while drawing.svf will invoke the SVF functionality. |
Listing drawings on the server(Avoid creating an HTML file for each drawing) |
When the viewer is a separate window, the "drawing" menu includes a "load" option. This option will list all available drawings on the server. This way you do not have to create a separate HTML file for each drawing on the server. To enable this option you must create a file called drawings.txt and place the file in the same directory as the viewer. If you would like to change the name of the list file or its location read this. The format of the file is simple. Each line lists one drawing on the server. All drawings must be in the same directory as the file listing them or in a directory below it. If a path is included it must be relative to the list file location (no ".." allowed). This means that drawings can be in the same directory as the file listing them or below the file. The format is
<file name with extension> <tab> <plain text description for the user> Example: color.dwf This is a color drawing directory/campus.dwf This is a campus If the file is placed on a unix server, make sure the permissions allow reading. Try accessing the file using your browser to confirm. |
Passing Viewer Params In The URL To The HTML Page |
All parameters can be passed via the URL to the HTML wrapper page. This means that a generic HTML wrapper can be created with no params. The viewer tag would look like this: <applet codebase="/path from web server root/" code="ViewerApplet.class" archive="obfu.jar" width=300 height=300 MAYSCRIPT> <param name="cabbase" value="obfu.cab"> </applet> If the URL to the page with this tag is at http://yourserver.com/drawings/draw.html, params can be passed as name value pairs. For example, to specify the 'name' param and have the viewer work inside the HTML page, use: http://yourserver.com/drawings/draw.html?name=/drawings/drawing1.dwf&type=panel |
Using A Generic HTML For Drawings (Script.html) |
Note that the script.html should be changed. "CHANGE ME" should be the path from the root of the server to the cadviewer.class location as with all other HTML pages. More info. For example, if the URL to the CADViewer files is http://www.host.com/cadviewer/ then the path should be /cadviewer/ and the codebase=\"CHANGE ME\" in the script.html should be changed to: codebase=\"/cadviewer/\"
Assume you have a set of drawings for each floor of a building. You want to create one HTML page the includes text regarding the building as well as links from the page to each of the floors. If you didn't use script.html, you would need to create a new HTML file for each floor. These files would contain the <applet ...> tag that invokes the viewer. Each HTML file would "point" to a drawing. Using the script.html, you can have all the links on the building HTML page point to the script.html file and pass the drawing name as a parameter in the URL. Lets assume that http://www.company.com/cadviewer/testing/script.html is the URL to script.html.
http://www.company.com/buildings/building1.html In this HTML page you add a link to a drawing http://www.company.com/buildings/topfloors/building1top.dwf as follows: <a href="http://www.company.com/cadviewer/testing/script.html?/buildings/topfloors/building1top.dwf"> click here for top</a> Note that the URL to the script.html has a "?" added to it. After the "?", you specify the
drawing path from the server root "/" (including the first "/"). This invokes the script.html
which calls the viewer and enters the name |
Upgrading Communicator to the latest Java(needed for printing only - Pro Version) |
Internet Explorer 4.0 includes the latest Java (JDK1.1) but Netscape Communicator (Earlier than version 4.05) did not. To upgrade, simply install a patch provided by netscape. You can find more information at http://developer.netscape.com/software/communicator/index.html?content=/software/jdk/download.html |
Using the redline "save" and "load" functionality (OPTIONAL)(Pro Version Only) |
Note: Users who cannot run cgi scripts (Some ISPs will not allow cgi scripts) can still use all viewer functionality minus the "save redline". When you finish installing the script make sure to test it using testscript.html.
/viewerdirectory *.class obfu.* etc. redsaver.cgi (Unix: premissions 750) /redlines (Unix: permission 770)
When you finish installing the script make sure to test it using testscript.html.
When you finish installing the script make sure to test it using testscript.html.
Perl installation and configuration on windows (Web Masters)Most users will not need to complete this step. Ask your web master whether perl is installed on the web server. This example is geared to IIS but should be the same for other web servers. You may not need to do this, try finding other *.pl files on the server and adding the redsaver.pl to the same directory. 1. Install perl for windows from the above URL (you may have installed it with your web server - search your computer for perl.exe). 2. Locate the program perl.exe on your system. 3. Edit the registry key (Use the start menu, then "run" and type regedit): HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \W3SVC \Parameters \ScriptMap From "edit" select "new" then "new value". Create a key with the name ".pl" and the value should b be the full path to perl.exe and %s example: d:\ntreskit\perl\perl.exe %s 4. Click ok. Exit regedit. 5. Restart the web server by going to the control pane | services find the web server service and click stop then start. 6. The last thing to do is place the redsaver.pl in an executable directory on the web server. |
Writing You Own Script / Integrating Redlines Into Your Own System(Optional - Advanced Web Skills Needed)(Pro Version Only) |
You may write your own script for saving redlines. For example, if you prefer to save the redlines to a database or have a specific convention you would like to use. This section describes how the viewer interacts with the script for saving redlines. When the viewer saves redlines, it will use the following name value pairs: The viewer will expect the following to happen: 1. The name of the file will be "dn"_"na".red 2. The redlines be be broken up into separate connections. If an HTTP GET is used by the viewer, the script should append the "red" value to the redline file. If an HTTP POST is used by the viewer, the script should simply create the file and write the "red" data to it.
3. In any case, the "red" value should be decoded from URL encoding to plain ascii. 4. The viewer will add the "reddir" param, but the script may ignore it. It is useful if for example, every drawing is in a unique directory and the redlines are saved to that directory. Using this param, one script can save to many locations.
|
Frequently Asked Questions (FAQ) |
Can the CADViewer run as a stand alone application or do I need to use a web server?
|
Troubleshooting Guide |
Viewer does not start:
The viewer starts ok, but no drawing appears or you get an error message saying "Java.io.IOException: There was an attemp to redirect a url request, but the attempt was not allowed by the client":
No interface appears
Can't print:
I am trying to load a new drawing using the "open" button in the viewer but I can't:
I am trying to view a drawing but the viewer says the format is not supported:
Can't save redlines:
Can't load redlines:
|
If you have any questions please mail support@cadviewer.com
, please note that the free Light product does not
include support.
again thanks
ZoomON Internet Software inc.