3DS図面
Contents
[
Hide
]3DSフォーマットをPDFにエクスポートする
Aspose.CAD for .NETは、開発者が3DSファイルをPDF形式にエクスポートすることを可能にします。3DSからPDFへの変換アプローチは以下のように機能します:
- Image.Loadファクトリメソッドを使用して3DS図面ファイルをロードします。
- CadRasterizationOptionsクラスのオブジェクトを作成し、PageHeightおよびPageWidthプロパティを設定します。
- PdfOptionsクラスのオブジェクトを作成し、VectorRasterizationOptionsプロパティを設定します。
- Image.Saveを呼び出し、PdfOptionsのオブジェクトを第2引数として渡します。
サンプルコード
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.3ds"; | |
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 3DS to PDF | |
string outPath = "output.pdf"; | |
image.Save(outPath, options); | |
} |