Message 1 of 7
Export current opened drawing to pdf file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, everyone.
Now I am making a function to save current drawing file to pdf file.
my simple code is as followings.
[CommandMethod("svp")]
public static void ExportPdf()
{
var documentManager = Application.DocumentManager;
var currentDocument = documentManager.MdiActiveDocument;
var db = currentDocument.Database;
var ed = currentDocument.Editor;
SaveFileDialog fileDialog = new SaveFileDialog();
fileDialog.DefaultExt = ".dwg"; // Required file extension
fileDialog.Filter = "Acad Files (*.dwg)|*.dwg|All Files (*.*)|*.*"; // Optional file extensions
fileDialog.ShowDialog();
string fname = fileDialog.FileName;
currentDocument.CloseAndSave(fname);
//using (Aspose.CAD.Image image = Aspose.CAD.Image.)
//{
// // Create an instance of CadRasterizationOptions and set its various properties
// Aspose.CAD.ImageOptions.CadRasterizationOptions rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions();
// rasterizationOptions.PageWidth = 1600;
// rasterizationOptions.PageHeight = 1600;
// // Create an instance of PdfOptions
// Aspose.CAD.ImageOptions.PdfOptions pdfOptions = new Aspose.CAD.ImageOptions.PdfOptions();
// // Set the VectorRasterizationOptions property
// pdfOptions.VectorRasterizationOptions = rasterizationOptions;
// // Export CAD to PDF
// image.Save(fname, pdfOptions);
//}
}
I hope someone's help. Thanks.