簡體   English   中英

從iframe中提取文本坐標

[英]Extract text coordinates from 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>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM