DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: cuiqingbo
今日帖子: 20
在线用户: 12
导航: 论坛 -> 发布代码 斑竹:liumazi,ruralboy  
作者:
男 good15 (good15) ★☆☆☆☆ -
普通会员
2019/4/2 15:18:14
标题:
PDF远程预览源码及简单调用 浏览:1962
加入我的收藏
楼主: PDF远程预览源码及简单调用
1.修改了PDF.js
prototype = {

    initalizeGraphics:
        function InternalRenderTask_initalizeGraphics(transparency) {

      if (this.cancelled) {
        return;
      }
      if (PDFJS.pdfBug && 'StepperManager' in globalScope &&
          globalScope.StepperManager.enabled) {
        this.stepper = globalScope.StepperManager.create(this.pageNumber - 1);
        this.stepper.init(this.operatorList);
       //  this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint();
      }
2.改了viewer.js
     if (!handled && !isViewerInPresentationMode) {
    // 33=Page Up  34=Page Down  35=End    36=Home
    // 37=Left     38=Up         39=Right  40=Down
    if (evt.keyCode >= 33 && evt.keyCode <= 40 &&
      !pdfViewer.containsElement(curElement)) {
       The page container is not focused, but a page navigation key has been
      pressed. Change the focus to the viewer container to make sure that
       navigation by keyboard works as expected.
      pdfViewer.focus();
    }
    // 32=Spacebar
    if (evt.keyCode === 32 && curElementTagName !== 'BUTTON' &&
      !pdfViewer.containsElement(curElement)) {
      pdfViewer.focus();
    }
  }
  3.调用案例
  http://192.168.3.220:9891/pdf/web/viewer.html?file=files/Delphi2010.pdf
 4.预览效果
----------------------------------------------
何和
作者:
男 yxsoft (yxsoft) ★☆☆☆☆ -
盒子活跃会员
2019/4/2 23:42:02
1楼: 这个怎么用?网页里面?
----------------------------------------------
Great!
作者:
男 good15 (good15) ★☆☆☆☆ -
普通会员
2019/4/3 8:17:05
2楼: 服务端网页,客户调用随便
----------------------------------------------
何和
作者:
男 good15 (good15) ★☆☆☆☆ -
普通会员
2019/4/3 8:46:08
3楼: PDF.js是pdf浏览的最好方式,任何pdf文件,改进了些而已
----------------------------------------------
何和
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行62.5毫秒 RSS