Esempio n. 1
0
        public static void SearchText()
        {
            //Please repace the trial key from trial-license.txt in download package
            //This license registration line need to be at very beginning of our other code
            LicenseManager.SetKey("trial key");

            //Copy "x86" and "x64" folders from download package to your .NET project Bin folder.
            PdfExtractor document = new PdfExtractor("sample.pdf");

            //Whether to match upper and lower case
            document.MatchCase = false;
            //Whether to match whole word only
            document.MatchWholeWord = true;

            //Search text in whole document
            List <TextInfo> infos = document.SearchText("text for search");

            //Search text in first page
            //List<TextInfo> infos = document.SearchText("text for search", 0);

            foreach (TextInfo info in infos)
            {
                Console.WriteLine(info.Text + "-" + info.PageId + "-" + info.Rect.X + "-" + info.Rect.Y);
            }
        }
Esempio n. 2
0
        public static void SearchText()
        {
            //Copy "x86" and "x64" folders from download package to your .NET project Bin folder.
            PdfExtractor document = new PdfExtractor("sample.pdf");

            //Whether to match upper and lower case
            document.MatchCase = false;
            //Whether to match whole word only
            document.MatchWholeWord = true;

            //Search text in whole document
            List <TextInfo> infos = document.SearchText("text for search");

            //Search text in first page
            //List<TextInfo> infos = document.SearchText("text for search", 0);

            foreach (TextInfo info in infos)
            {
                Console.WriteLine(info.Text + "-" + info.PageId + "-" + info.Rect.X + "-" + info.Rect.Y);
            }
        }