DrawingWeb Documentation - v1.0.0

Drawing in Web

Drawing inWeb is a library that provides an API for working with dwg and dxf files directly in the browser.

The API is very close to the API of the desktop SDK but with some changes. Since this is only an alpha version, there may be performance issues or bugs. Please, if you find these, you can leave a report using the link: https://www.opendesign.com/support

Also, the documentation is not ready yet, so you can use the documentation for the desktop SDK. https://docs.opendesign.com/td/

!!! IMPORTANT !!! The current version is not intended for use in a ready-made solution. This is an beta version that is suitable for getting acquainted with the API of the new library and for creating prototypes.

Archive contains 2 directories:

  • ProtectionServer - a server that processes requests to download library files to the browser. In general, this is a regular static web server for library files.

Only one ProtectionServer is enough to operate. Upon request, a Drawing inWeb library is loaded into the browser through which you can download files and work with them. The library is available at the following link: http://127.0.0.1:5000/Files/DrawingWeb.js

  • It is possible that upon startup, dotnet will launch a secure server on a different port.

For ODA developers and founding members

  • run python3 ODAProjectFileGenerator.py
  • if ODAProjectFileGenerator have some problems with find emscripten toolchain path, please check main/build/platforms/emcc_linux.cfg line <environment type="var" key="EMSCRIPTEN_ROOT_PATH">/emsdk/upstream/emscripten</environment>
  • select `emcc x.xx.x (cross compilation to JS)'
  • select dependencies (DrawingWeb)
  • select build type release (press Enter by default)
  • select folder name emcc_linux (press Enter by default)

project will be generated to main/CMakePlatforms/emcc_linux

  • run cd CMakePlatforms/emcc_linux
  • run make -j4 DrawingWeb

project will be builded to main\bin\emcc_linux

You can use official emsdk manual

or use our quick start guide:

#Get the emsdk repo
git clone https://github.com/emscripten-core/emsdk.git

# Enter that directory
cd emsdk

# Fetch the latest version of the emsdk (not needed the first time you clone)
git pull

# Download and install the latest SDK tools.
./emsdk install sdk-3.1.50-64bit

# Make the "latest" SDK "active" for the current user. (writes ~/.emscripten file)
./emsdk activate sdk-3.1.50-64bit

# Activate PATH and other environment variables in the current terminal
source ./emsdk_env.sh

# Check emsdk install correctly
emcc -v

If you have problems installing emsdk according to our brief instructions, then use the official emsdk installation documentation

Еhese dependencies are needed for the ODA perl project generator to work correctly

cmake 3.12

cmake install 3.12:

mkdir cmake 
cd cmake
wget https://cmake.org/files/v3.12/cmake-3.12.1-Linux-x86_64.tar.gz
tar zxf cmake-3.12.1-Linux-x86_64.tar.gz
ln -s ./cmake-3.12.1-Linux-x86_64/bin/cmake /usr/bin/cmake

libs:

apt install -y build-essential git-core python default-jre wget libexpat1-dev make

*** Run with protection server ***

  • Copy DrawingWeb files:

    • Copy files DrawingWeb.js and DrawingWeb.wasm to InWeb.FileProtectionServer/src/InWeb.FileProtectionServer/Files
  • Compile server

    • Go to the server project root folder InWeb.FileProtectionServer (a folder that contains InWeb.FileProtectionServer.sln file)
    • run command dotnet build -c Release
  • Run server

    • run command cd src/InWeb.FileProtectionServer/bin/Release/net8.0
    • run command dotnet InWeb.FileProtectionServer.dll

then

  • Run http server with proxy requests npx http-server -p 3000 -cors -P http://localhost:5190/Files