/// <summary> /// Make a HTML-formatted string with hOCR markup from the internal data structures. /// </summary> /// <param name="pageNumber">pageNumber is 0-based but will appear in the output as 1-based.</param> /// <returns>A HTML-formatted string with hOCR markup from the internal data structures.</returns> public String GetHOCRText(int pageNumber = 0) { using (Util.VectorOfByte bytes = new Util.VectorOfByte()) { OcrInvoke.TessBaseAPIGetHOCRText(_ptr, pageNumber, bytes); return(UtfByteVectorToString(bytes)); } }
/// <summary> /// Get all the text in the image /// </summary> /// <returns>All the text in the image</returns> public string GetUTF8Text() { using (Util.VectorOfByte bytes = new Util.VectorOfByte()) { OcrInvoke.TessBaseAPIGetUTF8Text(_ptr, bytes); return(UtfByteVectorToString(bytes)); } }
/// <summary> /// Get all the text in the image /// </summary> /// <returns>All the text in the image</returns> public string GetText() { using (Util.VectorOfByte bytes = new Util.VectorOfByte()) { TessBaseAPIGetUTF8Text(_ptr, bytes); return(_utf8.GetString(bytes.ToArray()).Replace("\n", Environment.NewLine)); } }
/// <summary> /// Get all the text in the image /// </summary> /// <returns>All the text in the image</returns> public string GetText() { using (Util.VectorOfByte bytes = new Util.VectorOfByte()) { OcrInvoke.TessBaseAPIGetUTF8Text(_ptr, bytes); #if NETFX_CORE byte[] bArr = bytes.ToArray(); return(_utf8.GetString(bArr, 0, bArr.Length).Replace("\n", Environment.NewLine)); #else return(_utf8.GetString(bytes.ToArray()).Replace("\n", Environment.NewLine)); #endif } }