JavaのVDWドキュメントの自動レイアウト
MicrosoftやOpenOffice、Adobe PDFなどのソフトウェアを使用せずに、サーバー側のAspose.Diagramfor JavaAPIを使用したネイティブで高性能な自動レイアウトVDWドキュメント。
Javaを使用してVDWファイルを自動レイアウトする方法
VDWファイルを自動レイアウトするために、
APIは、機能が豊富で、強力で、使いやすい合併APIfor Javaプラットフォームです。最新バージョンはから直接ダウンロードできます
次の構成をpom.xmlに追加して、Mavenベースのプロジェクトにインストールします。
リポジトリ
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.com/repo/ </ url>
</repository>
依存
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-diagram</artifactId>
<version>version of aspose-diagram API</version>
<classifier>jdk17</classifier>
</dependency>
JavaのVDWファイルを自動レイアウトするための手順
基本的なドキュメントの自動レイアウト
APIは、ほんの数行のコードで実行できます。
+新しいDiagramオブジェクトを開きます +IDでページを選択 +ページのレイアウト機能を使用する save()メソッドを呼び出し、ファイル名(フルパス)とフォーマット(VSDX)をパラメーターとして渡します。 +これで、Microsoft Office、Adobe PDF、またはその他の互換性のあるプログラムでVSDXファイルを開いて使用できるようになりました。
システム要求
Aspose.Diagram for Javaは、すべての主要なプラットフォームとオペレーティングシステムでサポートされています。次の前提条件があることを確認してください。
- MicrosoftWindowsまたはJSP/JSFアプリケーションおよびデスクトップアプリケーション用のJavaランタイム環境と互換性のあるOS。- Aspose.Diagramfor Javaの最新バージョンを直接入手する Maven 。
自動レイアウトVDWファイル-Java
// For complete examples and data files, please go to https://github.com/aspose-diagram/Aspose.Diagram-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(LayOutShapesInCompactTreeStyle.class); | |
String fileName = "LayOutShapesInCompactTreeStyle.vdx"; | |
// load an existing Visio diagram | |
Diagram diagram = new Diagram(dataDir + fileName); | |
// set layout options | |
LayoutOptions compactTreeOptions = new LayoutOptions(); | |
compactTreeOptions.setLayoutStyle(LayoutStyle.COMPACT_TREE); | |
compactTreeOptions.setEnlargePage(true); | |
// set layout direction as DownThenRight and then save | |
compactTreeOptions.setDirection(LayoutDirection.DOWN_THEN_RIGHT); | |
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.setDirection(LayoutDirection.DOWN_THEN_LEFT); | |
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.setDirection(LayoutDirection.RIGHT_THEN_DOWN); | |
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.setDirection(LayoutDirection.LEFT_THEN_DOWN); | |
diagram.layout(compactTreeOptions); | |
diagram.save(dataDir + "sample_left_down.vdx", SaveFileFormat.VDX); |
約Aspose.Diagramfor JavaAPI
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などのさまざまなファイル形式に変換する機能を提供します。
続きを読む