During my evaluation of the Aspose.CAD for .Net product, I have ran into issues getting some Hatch patterns to show up on the output PDF correctly. Solid patterns are the only ones that seem to work fine. The Net pattern displays but does not scale or rotate correctly. The Line and the Earth pattern do not even display.
Here is the code I use to setup the PDF:
private static readonly int PageWidth = 792;
private static readonly int PageHeight = 612;
public static void SavePrint(System.IO.Stream dxfStream, string savePath)
{
using (CadImage cadImage = (CadImage)Image.Load(dxfStream))
{
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
rasterizationOptions.AutomaticLayoutsScaling = true;
rasterizationOptions.CenterDrawing = true;
rasterizationOptions.DrawType = CadDrawTypeMode.UseObjectColor;
rasterizationOptions.GraphicsOptions.InterpolationMode = InterpolationMode.HighQualityBilinear;
rasterizationOptions.GraphicsOptions.SmoothingMode = SmoothingMode.AntiAlias;
rasterizationOptions.Layouts = new string[] { “Layout” };
rasterizationOptions.PageHeight = PageHeight;
rasterizationOptions.PageWidth = PageWidth;
rasterizationOptions.ScaleMethod = ScaleType.ShrinkToFit;
rasterizationOptions.TypeOfEntities = TypeOfEntities.Entities2D;
rasterizationOptions.BackgroundColor = Color.White;
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.VectorRasterizationOptions = rasterizationOptions;
cadImage.Save(savePath, pdfOptions);
}
}<br><br></span></pre>Am I correctly configuring the PdfOption object and CadRasterizationOption object?<br><br>I have attached the PDF results from Aspose.CAD and from AutoCAD and the original dxf file.<br><br>Thank you,<br>Ryan<br><br>