try
{file = new File(filePath);}
catch(Exception e)
{throw new RuntimeException(filePath + " file access error.",e);}
Document document = file.getDocument();
// 2. Link extraction from the document pages.
TextExtractor extractor = new TextExtractor();
extractor.setAreaTolerance(2); // 2 pt tolerance on area boundary detection.
boolean linkFound = false;
for(Page page : document.getPages())
{
if(!promptNextPage(page, !linkFound))
return false;
Map<Rectangle2D,List<ITextString>> textStrings = null;