title: PDFBox retrieve text from overlapping boxes
body: <p>I've had some success using the <a href="https://pdfbox.apache.org/docs/2.0.3/javadocs/index.html?org/apache/pdfbox/text/PDFTextStripperByArea.html" rel="nofollow noreferrer"><code>PDFTextStripperByArea</code></a> class to retrieve text contained within a specified rectangle. However, some of the PDFs I an scraping have text that is in slightly different places from page to page. I'm looking for help in how to deal with this.</p>
  
  <p>In the example below, I can open the PDF in Acrobat Edit mode and see multiple text boxes (outlines with thin grey lines). I have indicated two regions (purple and red) that I would like to extract text from. However, instead of just getting the text physically inside the rectangle, I'd like all the text from the overlapping text boxes.
  <a href="https://i.stack.imgur.com/sc3uT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sc3uT.png" alt="Example PDF with regions overlapping with text boxes"></a></p>
  
  <p>Is there a way to do this?</p>