从 iframe 中提取文本坐标



我想从iframe中选择一个区域并将坐标发送到后端。更具体地说,我想做的是让用户从文件(pdf(中选择一个存在表格的区域。我该怎么做?

谢谢你帮助我

看 https://github.com/tapmodo/Jcrop,它是演示。

<Iframe src="" id="frame"/>

还有剧本:

<script type="text/javascript">
jQuery(function($){
  $('#frame').Jcrop({
    onChange:   showCoords,
    onSelect:   showCoords
  });
});
// Simple event handler, called from onChange and onSelect
// event handlers to show an alert, as per the Jcrop 
// invocation above
function showCoords(c)
{
  alert('x='+ c.x +' y='+ c.y +' x2='+ c.x2 +' y2='+ c.y2)
  alert('w='+c.w +' h='+ c.h)
};
</script>

最新更新