private ICollection <Rectangle> ProcessPage(ILocationExtractionStrategy strategy, PdfPage page)
        {
            PdfCanvasProcessor parser = new PdfCanvasProcessor(strategy);

            parser.ProcessPageContent(page);
            IList <Rectangle> retval = new List <Rectangle>();

            foreach (IPdfTextLocation l in strategy.GetResultantLocations())
            {
                retval.Add(l.GetRectangle());
            }
            return(retval);
        }
Example #2
0
        public virtual ICollection <IPdfTextLocation> GetResultantLocations()
        {
            locations.Clear();
            // build return value
            ICollection <IPdfTextLocation> retval = new HashSet <IPdfTextLocation>();

            for (int i = 0; i < strategies.Count; i++)
            {
                ILocationExtractionStrategy    s     = strategies[i];
                ICollection <IPdfTextLocation> rects = s.GetResultantLocations();
                retval.AddAll(rects);
                locations.Put(i, new HashSet <IPdfTextLocation>(rects));
            }
            IList <IPdfTextLocation> rectangles = new List <IPdfTextLocation>(retval);

            JavaCollectionsUtil.Sort(rectangles, new _IComparer_93());
            // return
            return(rectangles);
        }