Package org.pdfbox.util

Examples of org.pdfbox.util.TextPosition


    }

    private Map coalesceLine(Map input) {
      final Map output = new TreeMap();
      final Iterator kit = input.keySet().iterator();
      TextPosition lastFragment = null;
        String lastString = null;
        Integer lastKey = null;
        while (kit.hasNext())
        {
          final Integer key = (Integer) kit.next();
          final TextPosition thisFragment = (TextPosition) input.get(key);
            if (lastFragment != null && adjacent(lastFragment, thisFragment))
            {
                lastFragment = thisFragment;
                lastString += thisFragment.getCharacter();
            }
            else
            {
                if (lastFragment != null)
                {
                    output.put(lastKey, lastString);
                }
                lastFragment = thisFragment;
                lastString = thisFragment.getCharacter();
                lastKey = key;
            }
            if (lastFragment != null)
            {
                output.put(lastKey, lastString);
View Full Code Here


    }

    private void regroup(final List fragments, final Map lines)
    {
        for (int i = 0; i < fragments.size(); i++) {
          final TextPosition textPosition = (TextPosition) fragments.get(i);
          final Integer y = new Integer((int)textPosition.getY());
          final Integer x = new Integer((int)textPosition.getX());
          final Map pieces;
            if (lines.containsKey(y)) {
                pieces = (TreeMap) lines.get(y);
            } else {
                pieces = new TreeMap();
View Full Code Here

TOP

Related Classes of org.pdfbox.util.TextPosition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.