2021-06-15 17:14:53
<template>
<div>
<iframe id="pdf" name="pdf"
src="static/web/viewer.html?file=compressed.tracemonkey-pldi-09.pdf"
style="width:100%; height:500px"></iframe>
</div>
</template>
import $ from "jquery";
export default {
created() {
this.$nextTick(()=>{
this.init()
})
},
methods:{
init(){
setTimeout(() => {
let createWindow = window.frames['pdf']
let pdf = window.frames['pdf'].document
$(pdf).find("#viewer").on('mouseup',() => {
const selection = createWindow.getSelection()
const text = selection.toString()
console.log(text)
})
},3000)
}
}
}
最后生成于 2023-06-27 21:37:48
热门推荐: