用mxdraw控件,似乎只支持ie。但支持中文字体最好,有小小水印,但是我们网页上打开图纸,不都是只是为了瞄一眼嘛,不在乎这点水印。

网页html web直接打开cad文件dwg格式等的方法_mxdraw

html调用代码:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0042)http://www.mxcad.net:2080/ie/database.html -->
<!DOCTYPE html PUBLIC "" "">
<HTML lang="en" style="height: 100%;">
<HEAD>
  <META content="IE=10.000" http-equiv="X-UA-Compatible">
  <META charset="UTF-8">
  <META name="GENERATOR" content="MSHTML 10.00.9200.17457">
  <META name="ProgId" content="FrontPage.Editor.Document">
  <TITLE>MxDraw控件</TITLE>
  <!--引入打碎函数-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/ExplodeFun.js" type="text/javascript"></SCRIPT>
  <!--移动夹点-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/MoveGripPointsFun.js" type="text/javascript"></SCRIPT>
  <!--返回夹点-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/GetGripPointsFun.js" type="text/javascript"></SCRIPT>
  <!--动态施放绘制事件回调函数指针-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/DoDynWordDrawFun.js" type="text/javascript"></SCRIPT>
  <!--引入参数绘制的相关函数-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/Draw.js" type="text/javascript"></SCRIPT>
  <!--引入交互绘制的相关函数-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/MxDyDraw.js" type="text/javascript"></SCRIPT>
  <!--引入光栅图处理的相关函数-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/MxIamges.js" type="text/javascript"></SCRIPT>
  <!--引入界面控制的相关函数-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/MxInterface.js" type="text/javascript"></SCRIPT>
  <!--引入控制事件的相关函数-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/MxEvents.js" type="text/javascript"></SCRIPT>
  <!--引入打印控制的相关函数-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/MxPrint.js" type="text/javascript"></SCRIPT>
  <!--引入选择集的相关函数-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/MxSelect.js" type="text/javascript"></SCRIPT>
  <!--引入自定义命令的相关函数-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/MxUserCustomCommand.js" type="text/javascript"></SCRIPT>
  <!--引入扩展数据的相关函数-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/MxData.js" type="text/javascript"></SCRIPT>
  <!--引入图面搜索的相关函数-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/MxMap.js" type="text/javascript"></SCRIPT>
  <!--引入图形数据库的相关函数-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/MxDataBase.js" type="text/javascript"></SCRIPT>
  <SCRIPT language="javascript" src="/static/js/mxdraw/mxcustom.js" type="text/javascript"></SCRIPT>
  <!--引入梦想控件-->
  <SCRIPT language="javascript" src="/static/js/mxdraw/mxocx.js" type="text/javascript"></SCRIPT>
  <SCRIPT src="/static/js/mxdraw/jquery.min.js"></SCRIPT>

  <SCRIPT language="JavaScript">document.oncontextmenu = new Function('event.returnValue=false;'); //禁用右键
  </SCRIPT>
</HEAD>

<BODY>

<DIV style="height: 900px;"><!--  width: 150%; float: right; -->
  <SCRIPT type="text/javascript">
        LoadMxDrawX("http://127.0.0.1/static/img/05.dwg", "", "");
  </SCRIPT>
</DIV>

</BODY>
</HTML>