DRC 図面
Contents
[
Hide
]DRC 図面を PDF にエクスポートする
Aspose.CAD は、AutoCAD DRC 図面エンティティをロードし、全体の図面を PDF 形式でレンダリングする機能を提供します。 DRC から PDF への変換アプローチは次のように機能します。
- Image.Load ファクトリメソッドを使用して DRC 図面ファイルをロードします。
- CadRasterizationOptions クラスのオブジェクトを作成し、PageHeight と PageWidth プロパティを設定します。
- PdfOptions クラスのオブジェクトを作成し、VectorRasterizationOptions プロパティを設定します。
- Image.Save を呼び出し、PdfOptions のオブジェクトを第二引数として渡します。
サンプルコード
以下のコードサンプルは、デフォルト設定を使用してファイルを変換する方法を示しています。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string inputFile ="file.drc"; | |
using (Image image = Image.Load(inputFile)) | |
{ | |
// Initialize PdfOptions class object | |
PdfOptions options = new PdfOptions(); | |
CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions(); | |
cadRasterizationOptions.PageHeight = 500; | |
cadRasterizationOptions.PageWidth = 500; | |
options.VectorRasterizationOptions = cadRasterizationOptions; | |
// Export DRC to PDF | |
string outPath = "output.pdf"; | |
image.Save(outPath, options); | |
} |