コード例 #1
0
        public static void InsertBookPages(int bookID, string path)
        {
            DataBaseTools.conn.Open();
            PdfReader reader   = new PdfReader(path);
            string    pagetext = "";

            for (int i = 1; i <= reader.NumberOfPages; i++)
            {
                pagetext = PdfTextExtractor.GetTextFromPage(reader, i);
                DataBaseTools.InsertBookPage(bookID, pagetext);
            }
            DataBaseTools.conn.Close();
            MessageBox.Show("Book " + bookID + " added with pages", "info", MessageBoxButtons.OK);
        }
コード例 #2
0
ファイル: PDFTools.cs プロジェクト: hanimounla/E-Library
        public static void InsertBookPages(int bookID, string path, int pagesCount)
        {
            string    pagetext          = "";
            string    picturesText      = "";
            PdfReader reader            = new PdfReader(path);
            RandomAccessFileOrArray raf = new RandomAccessFileOrArray(path);

            for (int pageID = 1; pageID <= pagesCount; pageID++)
            {
                pagetext     = ConvertArabic(PdfTextExtractor.GetTextFromPage(reader, pageID));
                picturesText = GetPictureText(pageID, reader, raf);
                DataBaseTools.InsertBookPage(bookID, pagetext, picturesText);
            }
            raf.Close();
            reader.Close();
        }