CADViewer JS Samples


The folder ../samples/ in CADViewer JS download CV-JS v2.3.6 contains a set of samples to help you get going with CADViewer JS.

Install Notes:

High resolution print in CADViewer JS as well as file load/save modals, redlines save/load, images insert save/load and DWG/DWF on-the-fly conversion requires that PHP is installed on the server.
Use PHP version 5.6.30 or above.
The print object will open on a web separate page, therefore allow pop-up's from the launching site.

Edit configuration file CV-JS_config.php in folder ./php to point to your server structure.

If PHP is not installed on your server, see section SAMPLE SETTINGS FOR SERVLETS - ALTERNATIVE TO DEFAULT PHP SETTING in the .html samples in the ./samples folder in CV-JS_2_3_6.zip on how to set up alternatively handlers. Currently Servlets are provides as an alternative to PHP for high resolution print and API controlled save/load of redlines. Download Servlets from: CV-JS_Servlets_01.zip. Sample with Servlets running under Tomcat controlling high resolution print and API controlled save/load of redlines, PDF multipage loading and SVG multipage index generation can be dowloaded from: CV-JS_2_3_6_servlets_based_demo.zip

If the user implementation is using sources from either different domains or different ports under the same domain, calling PHP may give a cross-domain error message. To set up the PHP files to allow multiple domains, edit the variable $allowed_domains to include all domains and ports from the user application. Download PHP files from: php-crossDomain.zip, edit and overwrite the PHP files into ./php folder in CV-JS_2_3_6.zip.

To load PDF files, Java needs to be installed on your server. Once Java is installed update the configuration file ./php/CV-JS_config.php to point at your Java and folder settings, alternatively update the web.xml parameters if running Servlets under Tomcat.

On Linux:
The converter AutoXchange ax2017_L64_01 in folder /CV-JS_2_3_6/converters/ax2017/linux needs full read write and executable rights, chmod 777.
To provide php with the proper access rights so it can execute AutoXchange, do edit User and Group in Apache environment variables /ect/apache2/apache2.conf (or similar), to point to your designated user.
The pdf creation script run_pdf.sh, needs full read write and executable rights, chmod 777.
To run the php scripts to save image as thumbnails and to save as multipage pdf, the gd library needs to be installed under php: user@user:mypath$ sudo apt-get install php5-gd.
To debug, use the apache and php log files, by default they can typically be found in /var/log/apache2/error.log.
Php typically have permissions set to chmod 755.

On Windows:
If you are using XAMPP, simply place the CV-JS_2_3_6 folder structure under C:\xampp\htdocs , alternatively C:\xampp\tomcat\webapps for Servlet version.

Samples


Samples which can be run standalone (no server):

1) Loading and display of CAD drawing pre-converted with AutoXchange. See file: CVJS_viewing_only_37.html

2) Loading and display of DWG drawing. Connects with an external server for on-the-fly conversion of CAD file. See file: CVJS_viewing_serverload_37.html.

Samples which requires server with php and AutoXchange, setup through CV-JS_config.php:

3) CADViewer JS is set up with interactive modals for file-loading and redlines. Links with AutoXchange for own server on-the-fly conversion control of CAD drawings. See file: CVJS_fileloader_37.html.

4) Similar to sample 3), but redline control icon disk is pre-set. See file: CVJS_fileloader_red_37.html.

5) Sample for embedding CADViewer JS in an encapsulating application. Redline handling of features such as locked users, hidden users, etc. are all Javascript API controlled. File and redline load/save are all done through API calls. See file: CVJS_redline_api_37.html.

6) Sample with image handling and object count menu page activated (icon menu page three). Images can be externally loaded an added to a location on the drawing. See file: CVJS_insert_image_37.html.

7) Sample illustrating the dynamic highlight API for coloring and labelling objects in a drawing. Sample also illustrates thumbnail generator and PDF generation of screen image with dynamic highlight (for reporting). See file: CVJS_loaddynamic_highlight_37.html.

8) Minimized version of CADViewer JS is used to batch convert a set of drawings to a multipage PDF. See file: CVJS_batchprint_to_pdf_37.html.

9) Handlers are added to SVG file so objects (layers) responds to mouse over, mouse click, etc. See file: CVJS_svg_clickhander_37.html.

10) Multiple SVG files are indexed for page browsing. See file: CVJS_svg_multipage_37.html.

Sample which requires server with php and MySQL. Install database ./CV-JS_2_3_6/databases/vizquery_public_demo.sql prior to running this sample:

11) AngularJS and PHP are used to dynamically load content from a MySQL database for two-way interaction with content in drawing. See file: CVJS_visual_query_37.html.

Sample which requires server with php and Java, setup through CV-JS_config.php:

12) Loading and display of multipage PDF document using on-the-fly conversion. See file: CVJS_pdf_multipage_37.html.




License Keys


License Key - CADViewer JS

CADViewer JS goes from trial to release mode by adding a license key cvlicense.js into a directory of choice.


License key folder

Set the license key folder as part of the declaration of CADViewer JS


		cvjs_setLicenseKeyPath("../javascripts/");


License Key - AutoXchange



AutoXchange goes from trial to release mode by adding a license key axlic.key into a directory of choice.


License key folder

Set the license key location as part of the initalization in the php file call-Api_09_ax2_config.php in the AutoXchange download.

//  Path to the location of the license key axlic.key file
	$licenseLocation = "/home/cadviewer/tms-restful-api/converters";

To learn more about licensing, please contact us at: Tailor Made Software