如何在另一个中调用pdf.js的页面呈现功能。 js文件 [英] How to call page render function of pdf.js in another . js file

查看:258
本文介绍了如何在另一个中调用pdf.js的页面呈现功能。 js文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在开发一个项目,我正在使用pdf.js在我的浏览器中加载pdf,我需要在pdf中突出显示一个文本,这是在按钮上完成的点击,当我点击第一次高亮没有完成,如果我第二次点击文本突出显示。在我目前的情况下,我得到容器div id我需要突出显示但我没有得到所有div的,因为PDF不是在我的浏览器中呈现。我的问题是如何在我的另一个highlight.js文件中调用页面渲染事件。



请帮助我。

谢谢你

Hi all,
I am working on a project where I am using pdf.js for loading a pdf in my browser and I need to highlight a text in the pdf and this is done on button click, when i click 1st time highlight is not done and if i click for 2nd time the text is highlighted.In my current case i am getting container div id where I need to highlight but I dont get all the div's as the pdf is not rendered in my browser. My question is how to call a page render event in my another highlight.js file.

Please help me for the same.
Thankyou

推荐答案

尝试处理将识别pdf已完全加载并准备就绪的事件。类似于jQueryready事件。



否则使用setTimeout来延迟突出显示的函数,以便在此期间加载pdf。
Try to handle the event which would identify that the pdf is fully loaded and ready. Something like jQuery "ready" event.

Otherwise use setTimeout to delay the function which highlights so that pdf will get loaded during that time.


这篇关于如何在另一个中调用pdf.js的页面呈现功能。 js文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆