การส่งออกภาพ COLLADA
Contents
[
Hide
]การส่งออกรูปแบบ COLLADA เป็น PDF
Aspose.CAD สำหรับ .NET ช่วยให้นักพัฒนาสามารถส่งออกไฟล์ COLLADA เป็นรูปแบบ PDF การแปลง COLLADA เป็น PDF ทำงานดังนี้:
- โหลดไฟล์ภาพวาด COLLADA โดยใช้วิธีโรงงาน Image.Load
- สร้างวัตถุของคลาส 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.dae"; | |
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 COLLADA to PDF | |
string outPath = "output.pdf"; | |
image.Save(outPath, options); | |
} |