javascript - Access PDF.js Viewer functionsevents - Stack Overflow

I am looking into putting together a small site that reads a few PDF files and loads them in the PDF.js

I am looking into putting together a small site that reads a few PDF files and loads them in the PDF.js viewer. (I want to use the viewer specifically) I still want all of the viewer UI and functionality present, just adding a sidebar with a list of files to chose from.

Alas I have not been able to really understand the PDF.js code (or a lot of the Viewer.js code provided for that matter)

Currently I am looking for a way to pass the PDF.js viewer a new file to open. (Without reloading the page and using the url parameter)

With that said that is only the bare minimum functionality to continue with this project.

I am also looking for something that can resemble a function reference for any of the Viewer / PDF.js functions that can be used for interactions:

  1. I/O of the files
  2. moving through pages / headings
  3. scaling the pdf
  4. any event triggers

I haven't been able to find anything direct from Mozzila's Github Wiki. And the recent tutorials that I have been able to find don't make use of the Viewer at all.

I am looking into putting together a small site that reads a few PDF files and loads them in the PDF.js viewer. (I want to use the viewer specifically) I still want all of the viewer UI and functionality present, just adding a sidebar with a list of files to chose from.

Alas I have not been able to really understand the PDF.js code (or a lot of the Viewer.js code provided for that matter)

Currently I am looking for a way to pass the PDF.js viewer a new file to open. (Without reloading the page and using the url parameter)

With that said that is only the bare minimum functionality to continue with this project.

I am also looking for something that can resemble a function reference for any of the Viewer / PDF.js functions that can be used for interactions:

  1. I/O of the files
  2. moving through pages / headings
  3. scaling the pdf
  4. any event triggers

I haven't been able to find anything direct from Mozzila's Github Wiki. And the recent tutorials that I have been able to find don't make use of the Viewer at all.

Share Improve this question edited Nov 19, 2013 at 5:41 BorisKourt asked Nov 18, 2013 at 22:20 BorisKourtBorisKourt 3073 silver badges15 bronze badges 2
  • Sounds like you missed github./mozilla/pdf.js/wiki/… and github./mozilla/pdf.js/wiki/… – async5 Commented Nov 19, 2013 at 12:59
  • As mentioned in the post though I would rather not do this via a the URL parameter and instead just pass it the new file in javascript directly. I am using the fully piled site version as well, but still don't have any idea on how to access any of the JS functionality – BorisKourt Commented Nov 19, 2013 at 14:37
Add a ment  | 

1 Answer 1

Reset to default 3

To open a file from a url:

PDFView.open(url, 0);

Set page:

PDFView.page = 2;

zoom/scale:

PDFView.zoomIn(10);
PDFView.zoomOut(10);

Basically just look at the PDFView object in viewer.js.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745111391a4611872.html

相关推荐

  • javascript - Access PDF.js Viewer functionsevents - Stack Overflow

    I am looking into putting together a small site that reads a few PDF files and loads them in the PDF.js

    10小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信