Extract all text

How to extract all text

Issue: How to extract all text.

Tips: To do this, you can use the GetStrings method, which allows you to get the entire text.

Note: You can extract all text from underlying drawing. Below is an example of extract all text. Attached are the result of console output (ExtractTextResult.bmp) and the source file (ExtractText.dwg).

Example:

string fileName = "ExtractText";
string file = string.Format("{0}.dwg", fileName);
using (FileStream inStream = new FileStream(file, FileMode.Open))
using (CadImage image = (CadImage)Image.Load(inStream))
{
foreach (string s in image.GetStrings())
{
Console.WriteLine(s);
}
}