VectorDraw Developer Framework
问:如何通过VectorDraw WebControl将VDS文件保存到DWG / DGN/span>
答:VectorDraw WebControl只能显示.vds文件,这是我们的web组件的文件格式,所以当你在页面上有一个.vds文件,并且你想把文件保存为DXF/DWG时,你必须创建一个服务,把vds文件上传到服务器上,把它转换为首选的支持的文件格式,然后通过 页下载。
下面是一些关于转换操作的说明。
为了做到这一点,需要编写一个web服务,用vdDocumentComponent引用VDF库,并且有两种方法让你的软件用户能够打开/保存DWG/DGN文件。
- 如果您的应用程序的用户想要打开/保存DWG/DGN文件,那么他们需要在他们的机器上安装FileConverter(Lite或Full)终端用户应用程序。
- 另一种方法是成为OpenDesign的会员,如果您还没有成为会员的话,可以使用他们的库,并将其与您的应用程序一起发布(在您应用程序的设置中)。
在这种情况下,必须在 “客户的机器 “中安装OpenDesign库中包含的一些dlls。
//Javascript code in the client machine vdcanvas.vdAfterSaveDocument =function(saveData) { //get the original filename var path = saveData.dataObject.pathname; if (!path) path = 'vdDocument.vds'; //Call the webservice here --> convert(saveData.dataStream,saveData.dataObject.pathname+".dwg"); } vdcanvas.SaveDocument(); //Webservice in the server machine //inputdata: inputdata is the data as come from web javascript method .Represents the contents of a vds file [System.Web.Services.WebMethod] public static void convert(string inputdata, string exportedfilename) { vdDocumentComponent vdc = new vdDocumentComponent(); vdDocument doc = vdc.Document; bool success = doc.FromScriptData(inputdata); if (success) { //save to a temporary relative folder in the server string exportedrelativefile = "./Drawings/"+ System.IO.Path.GetFileNameWithoutExtension(exportedfilename) success = doc.ExportToFile(exportedrelativefile); } }
=======================================================
如果您对想要购买正版授权VectorDraw Developer Framework(VDF),可以联系在线客服>>咨询相关问题。
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!