简体   繁体   English

从iframe中提取文本坐标

[英]Extract text coordinates from iframe

I want to select a region from an iframe and send the coordinates to the backend. 我想从iframe中选择一个区域,然后将坐标发送到后端。 More specifically what I want to do is let the user select an area from a file(pdf) where a table is present. 更具体地说,我想让用户从存在表的文件(pdf)中选择一个区域。 How do I go about doing this? 我该怎么做呢?

Thanks for helping me 谢谢你帮我

See https://github.com/tapmodo/Jcrop and it's demos. 参见https://github.com/tapmodo/Jcrop及其演示。

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

And the script: 和脚本:

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM