Пример #1
0
        public BlockPage Process(BlockPage page)
        {
            if (this._lines == null)
            {
                PdfReaderException.AlwaysThrow("AddTableHorizontalLines requires IdentifyTables");
            }

            if (page.IsEmpty())
            {
                return(page);
            }

            var result = new BlockPage();

            foreach (var block in page.AllBlocks)
            {
                result.Add(block);
            }

            bool foundFooter = false;

            foreach (var block in _lines)
            {
                // ignore the line at the footer
                if (IsBelowBody(block, page))
                {
                    foundFooter = true;
                    continue;
                }

                // if it is part of a table border with background
                if (IsBackgroundGrid(block))
                {
                    continue;
                }

                if (HasOverlapWithBlockset(block, page))
                {
                    continue;
                }

                result.Add(block);
            }

            if (foundFooter == false)
            {
                PdfReaderException.Warning("expected to find a line in the footer");
            }

            return(result);
        }
Пример #2
0
        public BlockPage Process(BlockPage page)
        {
            if (this._lines == null)
            {
                PdfReaderException.AlwaysThrow("AddTableHorizontalLines requires IdentifyTables");
            }

            if (page.IsEmpty())
            {
                return(page);
            }

            var result = new BlockPage();

            foreach (var block in page.AllBlocks)
            {
                result.Add(block);
            }

            foreach (var block in _lines)
            {
                // if it is part of a table border with background
                if (IsBackgroundGrid(block))
                {
                    continue;
                }

                if (HasOverlapWithBlockset(block, page))
                {
                    continue;
                }

                result.Add(block);
            }

            return(result);
        }