title: pdfbox getcharacterbyarticle() rendering the vector for last page
body: <p>I am trying to get text details like co-ordinates, width and height using the following code (took up this solution from <a href="https://stackoverflow.com/questions/20878170/how-to-determine-artificial-bold-style-artificial-italic-style-and-artificial-o/20924898#20924898">here</a>), but the output was only the text from the <strong>last page</strong>. </p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>public static void main( String[] args ) throws IOException    {
          PDDocument document = null;
          String fileName = "apache.pdf"
  
          PDFParser parser = new PDFParser(new FileInputStream(fileName));
          parser.parse();
  
          StringWriter outString = new StringWriter();
  
          CustomPDFTextStripper stripper = new CustomPDFTextStripper();
          stripper.writeText(parser.getPDDocument(), outString);
  
          Vector&lt;List&lt;TextPosition&gt;&gt; vectorlistoftps = stripper.getCharactersByArticle();
  
          for (int i = 0; i &lt; vectorlistoftps.size(); i++) {
              List&lt;TextPosition&gt; tplist = vectorlistoftps.get(i);
              for (int j = 0; j &lt; tplist.size(); j++) {
                  TextPosition text = tplist.get(j);
                  System.out.println(" String "
                          + "[x: " + text.getXDirAdj() + ", y: "
                          + text.getY() + ", height:" + text.getHeightDir()
                          + ", space: " + text.getWidthOfSpace() + ", width: "
                          + text.getWidthDirAdj() + ", yScale: " + text.getYScale() + "]"
                          + text.getCharacter() +" Font "+ text.getFont().getBaseFont() + " PageNUm "+ (i+1));
              }
          }
  } 
  </code></pre>
  
  <p><strong>CustomPDFTextStripper</strong>  class:</p>
  
  <pre><code>class CustomPDFTextStripper extends PDFTextStripper
  {
      //Vector&lt;Vector&lt;List&lt;TextPosition&gt;&gt;&gt; data = new Vector&lt;Vector&lt;List&lt;TextPosition&gt;&gt;&gt;();
      public CustomPDFTextStripper() throws IOException {
          super();
      }
  
      public Vector&lt;List&lt;TextPosition&gt;&gt; getCharactersByArticle(){
         // data.add(charactersByArticle);
          return charactersByArticle;
      }
  }
  </code></pre>
  
  <p>I tried to add the vectors to a list, but when calling the <strong>stripper()</strong> it is iterating through all the pages and the last page details are stored in <strong>charactersByArticle</strong> vector and thus returning the same. How do I get info for all pages??</p>