Aspose Cad run at first time is very slow exporting the PDF from a DXF File. After that is OK is fast until I restart the application.
I saw some fix in Aspose.Writer is there anything on Aspose.CAD
running version 23.9.0.0
.developing using on .net 4.6.2 C#
it stays long time here >> cadimage.Save(outputPDF, pdfOptions);
code I am using
the only thing different is an output error for first document
Exception thrown: ‘System.NullReferenceException’ in itextsharp.dll (5.5.13) error appear once
on any other version I have multiple itextsharp.dll errors (as mentioned) on each conversion.
using (FileStream cad = new FileStream(sourceFilePath, FileMode.Open, FileAccess.Read, FileShare.Read))
{
using (Aspose.CAD.Image cadimage = Aspose.CAD.Image.Load(cad))
{
// Create an instance of CadRasterizationOptions and set its various properties
Aspose.CAD.ImageOptions.CadRasterizationOptions rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions();
int x = cadimage.Width;
int y = cadimage.Height;
rasterizationOptions.PageWidth = 17;
rasterizationOptions.PageHeight = 11;
rasterizationOptions.AutomaticLayoutsScaling = true;
rasterizationOptions.NoScaling = false; // changed
rasterizationOptions.UnitType = UnitType.Inch;
// 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
string outputPDF = Path.Combine(Path.GetDirectoryName(sourceFilePath), Path.GetFileNameWithoutExtension(sourceFilePath) + @".pdf");
cadimage.Save(outputPDF, pdfOptions);
}
}