利用Aspose.Imaging for .NET转换AutoCAD DXF到PDF

2014-11-24 01:43:08 · 作者: · 浏览: 3

Aspose.Imaging for .NET 2.0.0现在已经发布,带来了新的AutoCAD DXF 2010文件格式读取功能,并能输出到PDF格式。


using Aspose.Imaging.FileFormats.Cad;
using Aspose.Imaging.ImageOptions;


namespace DxfExamples
{
///


/// Represents test examples for DXF -> PDF export
///

public class DxfExamples
{
///
/// Default export.
///

public void DefaultExport()
{
// Name of the file
string filename = "Drawing1.dxf";


// Load an image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(filename))
{
// Create options
PdfOptions pdfOptions = new PdfOptions();


// Set output file size
pdfOptions.PageWidth = 800;
pdfOptions.PageHeight = 600;


// Export
image.Save(filename + ".pdf", pdfOptions);
}
}
}
}