<p>I am trying to write a web-app to manage references for my PhD thesis.</p>

<p>I used to manage this information inside a personal Confluence (fantastic tool! - <a href="http://www.atlassian.com/software/confluence/" rel="nofollow noreferrer">http://www.atlassian.com/software/confluence/</a>) instance however I'm fed-up with the opening of PDF's and cutting and pasting values into fields that I wish to record.</p>

<p>I have exposed a webservice that will return me images based on a PDF filename and a page number. The same webservice also exposes a method that will return the text inside of a provided rectangle (top left x-y coord, bottom right x-y coord).</p>

<p>I would like to be able to drag a rectangle over part of the PDF image and then call the webservice to give me the text (which I will then store on a EntityBean). I am looking at using the JBoss application stack (Application Server, Hibernate, Seam and Richfaces). Does anybody know how I could go about achieving this? I have seen the ability to draw custom images in other RIA toolkits (e.g. dojo), but I can't see a way of doing this inside of Richfaces.</p>

<p>Hopefully somebody out there could prove me wrong, or provide some idea about what I can do (as I am not a web developer - I'm mainly building this tool because the RIA frameworks available now have got me interested!)</p>

<p>I already have the code to extract the text, my problem is purely how can I get the user to draw a "selection rectangle" inside the web browser over the top of the image?</p>

<p>Many Thanks,</p>

<p>Aidos</p>

[{'answer_id': 71007, 'author': 'Andy MacGilvery', 'author_id': 5546, 'author_profile': 'https://Stackoverflow.com/users/5546', 'pm_score': 1, 'selected': False, 'text': '<p>Try using the <a href="http://livedemo.exadel.com/richfaces-demo/richfaces/paint2D.jsf?c=paint2d&amp;tab=usage" rel="nofollow noreferrer">RichFaces Paint 2D</a> tag</p>\n\n<p>It exposes the <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Graphics2D.html" rel="nofollow noreferrer">Graphics2D</a> package to the user interface.</p>\n\n<p>Track user drag events on the image using javascript, then post the co-ordrdinates to the backing bean to re-render the image with a drawn on selection box.</p>\n'}, {'answer_id': 386521, 'author': 'anders.norgaard', 'author_id': 8805, 'author_profile': 'https://Stackoverflow.com/users/8805', 'pm_score': 0, 'selected': False, 'text': '<p>Have you considered <a href="http://www.mendeley.com/" rel="nofollow noreferrer">Mendeley</a> ? It will try to parse and extract bibliographic information from your pdfs.</p>\n'}, {'answer_id': 1310826, 'author': 'SomaSekhar', 'author_id': 92076, 'author_profile': 'https://Stackoverflow.com/users/92076', 'pm_score': 0, 'selected': False, 'text': '<p>you can do it with itext (<a href="http://www.lowagie.com/iText/" rel="nofollow noreferrer">http://www.lowagie.com/iText/</a>)</p>\n'}]
['https://Stackoverflow.com/questions/70890', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']