How to set up File Conversion Module to work with CADViewer
1) How it works
CADViewer can only view dwf files. When CADViewer opens a file differnet from a "dwf" file,
it will send the file url to the server script that calls the conversion module to convert on the fly this none "dwf" file to a dwf file . The dwf file is then sent back
to CADViewer for viewing.
2) CADViewer Enterprise distribution package should include:
One or more File Conversion Module Software (i.e. AutoXchange (AX2010 - AX2011), Hp2Xchange,
AcroXchange, RasterXchange or DgnXchange)
Server Side scripts
Servlet : "ConversionServlet.class", "ConversionServlet$1.class", "ConversionServlet$2.class",
"ConversionSetup.class" and cadviewer_ent.cfg" file
Perl Script: ConversionCGI.pl
CADViewer Pro java applet or CADViewer Java DWF class library
3) Conversion Module
You can install either the ConversionServlet or conversionCGI.pl on your server
A) Install ConversionServlet
Install File Conversion Module(s) to folder(s) of your choice
Make sure that you can execute the FCM from a shell or dos console
If autoxchange prompts for password, it means that the tool is not registered.
Do not continue with the installation. You need to contact support@cadviewer.com to get the password.
Copy "ConversionServlet.class", ConversionServlet$1.class", "ConversionServlet$2.class",
to the Servlet Container folder. Typically, the servlets will be in WEB-INF/classes directory.
Modify "web.xml" in WEB-INF if applicable and reset your servlet container, typically you'll have to add the following:
Change the values of $tempFolder,$axselect_path, $autoxchange_path, $dgnxchange_path,$hp2xchange_path
and $acroxchange_path
Rename axselect_windows or axselect_linux to axselect.exe
You should give execute permissions to ConversionCGI.pl; you also should
not give write permission for group or world for the script or directory
where the script reside. Generall that's achieved by chmod 755 or chmod
501 over the script.
Make sure that ConversionCGI.pl can write files to $tempFolder and execute
system command
4) CADViewer
Install CADViewer
In the viewer.cfg file, add the following line:
conversionURL=URL where URL is the URL to the servlet (i.e http://www.xyz.com:8080/servlets/ConversionServlet)
or add the following line to the parameter tag in HTML:
When you launch the html file, if it works correctly, you should see both the dwg and dwf
files in the tempdrawings folder
If you see the dwg and dwf files in the tempdrawings folder but CV does not display
anything, there is a problem with the communication between CV and the server. The setup on your
server might not let CV to get the dwf file
If you see the dwg file but don't see the dwf file, then the servlet cannot call the conversion tool
If you don't see neither the dwg or dwf file, then you should check to make sure that
you enter the param 'conversionurl" correctly on the html file
6) Notes
LINUX: it is not sufficient to copy the libpdf.so library to /usr/lib or /usr/local/lib, as suggested by the readme that comes with the distribution. You also need to set LD_LIBRARY_PATH=/the/library/with/the/so and export it. If you place the libpdf.so in the /etc/local/lib folder, one possible solution would be to place the following two lines to the /etc/profile file
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
You might need to log off and log in for the change to become active.
LINUX: if the servlet cannot execute the conversion module and the web container log shows an entry similar to:
cannot execute /fcmpath/autoxchange -sp=2 -I=/drawingpath/temp/file.dwg -O=/drawingpath/temp/file.dwf -f=dwf
but you can execute the module from a shell, you might want to check the ownership of the module. Perform chown to the same user/group that the web container/JVM process is running under.