Ejemplo n.º 1
0
        public void ImageExtractPdfTextTest(string path, string code)
        {
            var extractor    = new PdfExtractor(new ContentImageExtractor());
            var rdpExtractor = new RpdContentExtractor(new RpdExtractorConfig(new List <string>(), new List <string>(), @"(?<code>\d\d\.0\d\.\d\d)($|\D)"));
            var bytes        = File.ReadAllBytes(path);

            var content = extractor.ExtractImageText(bytes, path).Result;
            var extract = rdpExtractor.Extract(content.Content);

            Assert.True(extract.Codes.Count > 0);
            Assert.AreEqual(code, extract.Codes.First());
        }