Hello,
We have an issue related to conversion of linearized SVG to DXF files.
For example, when we upload an SVG file and convert it into DXF using the code below, the linearized text for “TOOL1” does not display vertically as in the SVG file.
Could you please suggest an approach to tackle this issue while also preserving the font?
The related SVG, DXF file and simplex font are available in this attachment: relatedFiles.zip (151.7 KB)
Thank you,
Victor
private static byte[] Linearize(byte[] input)
{
using (Stream stream = new MemoryStream(input))
{
using (CadImage cadImage = (CadImage)Aspose.CAD.Image.Load(stream))
{
CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions
{
DrawType = CadDrawTypeMode.UseObjectColor,
ShxFonts = new[]
{
Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + Path.DirectorySeparatorChar + "simplex.shx"
}
};
var dxfOptions = new Aspose.CAD.ImageOptions.DxfOptions
{
VectorRasterizationOptions = cadRasterizationOptions,
TextAsLines = true
};
using (MemoryStream outputStream = new MemoryStream())
{
cadImage.Save(outputStream, dxfOptions);
return outputStream.ToArray();
}
}
}
}