public virtual void TestTxtStringOutput() { FileInfo file = new FileInfo(TEST_IMAGES_DIRECTORY + "multîpage.tiff"); IList <String> expectedOutput = JavaUtil.ArraysAsList("Multipage\nTIFF\nExample\nPage 1", "Multipage\nTIFF\nExample\nPage 2" , "Multipage\nTIFF\nExample\nPage 4", "Multipage\nTIFF\nExample\nPage 5", "Multipage\nTIFF\nExample\nPage 6" , "Multipage\nTIFF\nExample\nPage /", "Multipage\nTIFF\nExample\nPage 8", "Multipage\nTIFF\nExample\nPage 9" ); String result = tesseractReader.DoImageOcr(file, OutputFormat.TXT); foreach (String line in expectedOutput) { NUnit.Framework.Assert.IsTrue(iText.IO.Util.StringUtil.ReplaceAll(result, "\r", "").Contains(line)); } }
private static void DoImageOcr(AbstractTesseract4OcrEngine tesseractReader, FileInfo imageFile) { tesseractReader.DoImageOcr(imageFile); }