Витягти увесь текст
Contents
[
Hide
]Як витягти увесь текст
Проблема: Як витягти увесь текст.
Поради: Для цього ви можете скористатися методом GetStrings, який дозволяє отримати весь текст.
Примітка: Ви можете витягти увесь текст з основного малюнка. Нижче наведено приклад витягнення всього тексту. Додані результати консолі (ExtractTextResult.bmp) та вихідний файл (ExtractText.dwg).
Приклад:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |