~Onlooker 2015-07-27 17:15 采纳率: 0%
浏览 317

自定义pdf.js

i would like to use pdf.js in my webApplication and customize it's view, so i can embedd it into the rest of my application (i was thinking about using an iframe).

At first i would like to get rid of most of the default toolbar-buttons like "print" or "download file" but keep the zoom and page navigation. Instead, i want these features (print/download) to appear inside my application's toolbar. How to do that? How can i hide the print/download buttons from the pdf.js toolbar and call this features with my custom buttons which are rendered inside my webapplication already?

Or should i use another library other than pdf.js?

Any information are very helpful!!

  • 写回答

2条回答 默认 最新

  • 7*4 2015-07-28 07:53
    关注

    Ok, i found how to do it. To hide a button simply add the CSS class "hidden" to it like "toolbarButton download hiddenMediumView hidden". To download the file, just call "PDFViewerApplication.download();". To print it, use window.print().

    All the handlers are listet in the view.js file. Just search for "// Event handling functions.". In my version it's on line 1840.

    I guess that's the simplest way. Of cours buttons could be removed completely from the DOM but that would mean to also alter the view.js file.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 matlab有关常微分方程的问题求解决
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考