翻譯|使用教程|編輯:李顯亮|2021-01-19 09:45:21.743|閱讀 274 次
概述:本系列教程整理了VectorDraw Developer Framework(VDF)最常見問題,教程整理的很齊全,非常適合新手學習。本文將會介紹如何通過Web服務將VDS另存為WebControl上的DWG。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
VectorDraw Developer Framework(VDF)是一個用于應用程序可視化的圖形引擎庫。有了VDF提供的功能,您可以輕松地創建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。該庫還支持許多矢量和柵格輸入和輸出格式,包括本地PDF和SVG導出。
點擊下載VectorDraw Developer Framework
問:如何通過VectorDraw WebControl將VDS文件保存到DWG / DGN?
答:VectorDraw WebControl只能顯示.vds文件,這是我們的web組件的文件格式,所以當你在頁面上有一個.vds文件,并且你想把文件保存為DXF/DWG時,你必須創建一個服務,把vds文件上傳到服務器上,把它轉換為首選的支持的文件格式,然后通過網頁下載。
下面是一些關于轉換操作的說明。
為了做到這一點,需要編寫一個web服務,用vdDocumentComponent引用VDF庫,并且有兩種方法讓你的軟件用戶能夠打開/保存DWG/DGN文件。
在這種情況下,必須在 "客戶的機器 "中安裝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),可以聯系咨詢相關問題。
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn