コード例 #1
0
ファイル: HtmlSplitter.cs プロジェクト: rajeshwarn/PDFtoEPUB
 private void GetPages(PatternSearcher searcher)
 {
     for (PatternFound found = searcher.NextPattern(_PagePattern); found.EndOfStreamReached == false; found = searcher.NextPattern(_PagePattern))
     {
         string page = ProcessHtmlPage(found.TextBeforePattern);
         if (string.IsNullOrEmpty(page) == false)
         {
             _Writer.AddPage(page);
         }
     }
 }
コード例 #2
0
ファイル: HtmlSplitter.cs プロジェクト: rajeshwarn/PDFtoEPUB
        private string GetHeader(PatternSearcher searcher)
        {
            PatternFound found = searcher.NextPattern(_BodyPattern);

            if (found.EndOfStreamReached == true)
            {
                throw new ApplicationException("Tag <Body> is not found.");
            }

            return(found.TextBeforePattern);
        }
コード例 #3
0
ファイル: HtmlSplitter.cs プロジェクト: rajeshwarn/PDFtoEPUB
 private void ProcessFile(string fileName)
 {
     try
     {
         using (StreamReader reader = new StreamReader(fileName))
         {
             PatternSearcher searcher = new PatternSearcher(reader, 8192);
             BuildHeader(searcher);
             _Writer = new HtmlWriter(_HtmlHeader, _HtmlFooter);
             GetPages(searcher);
         }
     }
     catch (Exception)
     {
     }
 }
コード例 #4
0
 private void BuildHeader(PatternSearcher searcher)
 {
     string header = GetHeader(searcher);
     _HtmlHeader = _BodyStartTag;
 }
コード例 #5
0
        private void ProcessFile(string fileName)
        {
            try
            {
                using (StreamReader reader = new StreamReader(fileName))
                {
                    PatternSearcher searcher = new PatternSearcher(reader, 8192);
                    BuildHeader(searcher);
                    _Writer = new HtmlWriter(_HtmlHeader, _HtmlFooter);
                    GetPages(searcher);
                }

            }
            catch (Exception)
            {

            }
        }
コード例 #6
0
 private void GetPages(PatternSearcher searcher)
 {
     for (PatternFound found = searcher.NextPattern(_PagePattern); found.EndOfStreamReached == false; found = searcher.NextPattern(_PagePattern))
     {
         string page = ProcessHtmlPage(found.TextBeforePattern);
         if (string.IsNullOrEmpty(page) == false)
         {
             _Writer.AddPage(page);
         }
     }
 }
コード例 #7
0
        private string GetHeader(PatternSearcher searcher)
        {
            PatternFound found = searcher.NextPattern(_BodyPattern);
            if (found.EndOfStreamReached == true)
            {
                throw new ApplicationException("Tag <Body> is not found.");
            }

            return found.TextBeforePattern;
        }
コード例 #8
0
ファイル: HtmlSplitter.cs プロジェクト: rajeshwarn/PDFtoEPUB
        private void BuildHeader(PatternSearcher searcher)
        {
            string header = GetHeader(searcher);

            _HtmlHeader = _BodyStartTag;
        }