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