简体   繁体   English

PDF.JS更改页面部分

[英]PDF.JS Change Page section

I want to customize the behaviour of previous and next buttons inside the PDF.JS Viewer. 我想自定义PDF.JS Viewer中上一个和下一个按钮的行为。 I've found that inside viewer.js there is: 我发现在viewer.js中有:

document.getElementById('previous').addEventListener('click',
  function() {
    PDFView.page--;
});
document.getElementById('next').addEventListener('click',
  function() {
    PDFView.page++;
});

For example I would like that, by clicking on the next button, does not change the page but just scroll down about 10 lines. 例如,我希望通过单击下一步按钮,不会更改页面,而仅向下滚动10行。

I hope that someone could help me. 我希望有人能帮助我。

Thanks 谢谢

-Antonio -安东尼奥

You have made half your way to the destination. 您已经到达目的地了一半。 However, you need to check the 但是,您需要检查

scrollIntoView = function pageViewScrollIntoView(dest){...}

the PDFView.page is responsible for the page, the scrollIntoView is responsible for the offset, which in this case what you are looking for. PDFView.page负责页面, scrollIntoView负责偏移量,在这种情况下,这是您要查找的内容。

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

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