C#のVDWドキュメントの自動レイアウト
MicrosoftやOpenOffice、Adobe PDFなどのソフトウェアを使用せずに、サーバー側のAspose.Diagramfor .NETAPIを使用したネイティブで高性能な自動レイアウトVDWドキュメント。
C#を使用してVDWファイルを自動レイアウトする方法
VDWファイルを自動レイアウトするために、
APIは、機能が豊富で、強力で、使いやすいドキュメント操作とC#プラットフォーム用のAPIのマージです。開ける
パッケージマネージャー、検索 ** Aspose.Diagram ** とインストールします。パッケージマネージャーコンソールから次のコマンドを使用することもできます。
指示
PM> Install-Package Aspose.Diagram
C#のVDWファイルを自動レイアウトするための手順
基本的なドキュメントの自動レイアウト
APIは、ほんの数行のコードで実行できます。
+新しいDiagramオブジェクトを開きます +IDでページを選択 +ページのレイアウト機能を使用する
- Save()メソッドを呼び出し、ファイル名(フルパス)とフォーマット(VSDX)をパラメーターとして渡します。 +これで、Microsoft Office、Adobe PDF、またはその他の互換性のあるプログラムでVSDXファイルを開いて使用できるようになりました。
システム要求
当社のAPIは、すべての主要なプラットフォームとオペレーティングシステムでサポートされています。以下のコードを実行する前に、システムに次の前提条件があることを確認してください。
- MicrosoftWindowsまたは.NETFramework、.NETコア、MonoまたはCOM相互運用機能を備えた互換性のあるOS- MicrosoftVisualStudioのような開発環境- Aspose.Diagramfor .NETプロジェクトで参照されているDLL-上の[ダウンロード]ボタンを使用してNuGetからインストールします
自動レイアウトVDWファイル-C#
// For complete examples and data files, please go to https://github.com/aspose-diagram/Aspose.Diagram-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir_Diagrams(); | |
string fileName = "LayOutShapesInCompactTreeStyle.vdx"; | |
// Load an existing Visio diagram | |
Diagram diagram = new Diagram(dataDir + fileName); | |
// Set layout options | |
LayoutOptions compactTreeOptions = new LayoutOptions(); | |
compactTreeOptions.LayoutStyle = LayoutStyle.CompactTree; | |
compactTreeOptions.EnlargePage = true; | |
// Set layout direction as DownThenRight and then save | |
compactTreeOptions.Direction = LayoutDirection.DownThenRight; | |
diagram.Layout(compactTreeOptions); | |
diagram.Save(dataDir + "sample_down_right.vdx", SaveFileFormat.VDX); | |
// Set layout direction as DownThenLeft and then save | |
diagram = new Diagram(dataDir + fileName); | |
compactTreeOptions.Direction = LayoutDirection.DownThenLeft; | |
diagram.Layout(compactTreeOptions); | |
diagram.Save(dataDir + "sample_down_left.vdx", SaveFileFormat.VDX); | |
// Set layout direction as RightThenDown and then save | |
diagram = new Diagram(dataDir + fileName); | |
compactTreeOptions.Direction = LayoutDirection.RightThenDown; | |
diagram.Layout(compactTreeOptions); | |
diagram.Save(dataDir + "sample_right_down.vdx", SaveFileFormat.VDX); | |
// Set layout direction as LeftThenDown and then save | |
diagram = new Diagram(dataDir + fileName); | |
compactTreeOptions.Direction = LayoutDirection.LeftThenDown; | |
diagram.Layout(compactTreeOptions); | |
diagram.Save(dataDir + "sample_left_down.vdx", SaveFileFormat.VDX); |
約Aspose.Diagramfor .NETAPI
Aspose.DiagramはMicrosoftVisioドキュメント形式の操作APIです。ダイグラム要素を含むロード、作成、変更、操作を簡単に実行し、Visio図をPDF、XPS、JPEG、PNG、BMP、TIFF、SVG、EMFなどの他の形式に変換できます。これはスタンドアロンのAPIであり、MicrosoftVisioやその他のソフトウェアをインストールする必要はありません。オンラインVDW自動レイアウトライブデモ
自動レイアウトVDWドキュメントは、 ライブデモのウェブサイト 。ライブデモには次の利点があります
VDW VDW ファイル形式とは
VDWは、Web図面のレンダリングに必要なストリームとストレージを指定するVisioグラフィックサービスファイル形式です。 Web図面は、ベクターまたはラスター図面としてレンダリングできる図面ページ、図形、フォント、画像、データ接続、およびdiagram更新情報のコレクションです。 VDWファイルはMicrosoftVisioでも開くことができますが、主にWebで使用するために保存されます。 Microsoft Visioは、VisioファイルをPNG、BMP、PDFなどのさまざまなファイル形式に変換する機能を提供します。
続きを読む