title: How to search some specific string or a word and there coordinates from a pdf document in java
body: <p>I am using Pdfbox to search a word(or String) from a pdf file and I also want to know the coordinates of that word.
  For example :- in a pdf file there is a string like "${abc}". I want to know the coordinates of this string.
  I Tried some couple of examples but didn't get the result according to me.
  in result it is displaying the coordinates of character.</p>
  
  <p>Here is the Code</p>
  
  <pre><code>@Override
  protected void writeString(String string, List&lt;TextPosition&gt; textPositions) throws IOException {
      for(TextPosition text : textPositions) {
  
  
          System.out.println( "String[" + text.getXDirAdj() + "," +
                  text.getYDirAdj() + " fs=" + text.getFontSize() + " xscale=" +
                  text.getXScale() + " height=" + text.getHeightDir() + " space=" +
                  text.getWidthOfSpace() + " width=" +
                  text.getWidthDirAdj() + "]" + text.getUnicode());
  
      }
  }
  </code></pre>
  
  <p>I am using pdfbox 2.0</p>