コード例 #1
0
        public static void ExtractTextFromPDF()
        {
            // Read a local PDF file in the disk
            PdfTextExtractor extractor = new PdfTextExtractor("sample.pdf");

            // Set layout of output text. If true, the extract text from pdf page will keey the location
            // from top to bottom, and from left to right, such as table, list, multi-column and so on.
            extractor.KeepTableLikeStyle = true;

            for (int i = 0; i < extractor.PageCount; i++)
            {
                // Extract text from each page of PDF
                string text = extractor.ExtractTextFromPage(i);
                Console.WriteLine(text);
            }
        }