Hello,
I have a DWG file that has plenty of text. Are you able to pull the text out using Aspose.CAD? In my example, nothing is being pulled from it. This is for .net.
architectural_-_annotation_scaling_and_multileaders.zip (128.8 KB)
Here is my function that I running the file through
public static string ExtractTextFromDwg(Stream input)
{
var text = new StringBuilder();
using(CAD.FileFormats.Cad.CadImage cadImage = (CAD.FileFormats.Cad.CadImage)CAD.Image.Load(input))
{
foreach(CAD.FileFormats.Cad.CadObjects.CadBaseEntity entity in cadImage.Entities)
{
try
{
dynamic entitytext = System.Convert.ChangeType(entity,entity.GetType());
if (!String.IsNullOrEmpty(entitytext.DefaultValue.ToString()))
{
text.AppendLine(entitytext.DefaultValue.ToString());
}
}
catch (Exception e)
{
}
}
}
return text.ToString();
}