【问题标题】:How to display PDF thumbnails in JSP pages如何在 JSP 页面中显示 PDF 缩略图
【发布时间】:2021-08-10 12:15:36
【问题描述】:

我尝试使用以下js,但似乎不可行。 PDF.js 'Hello, world!' example

我该如何解决?

function dispPhoto(file,suffix) {
  var $thumbArea = $('#thumbnail'+suffix);
  $thumbArea.empty();
  $('#fileName'+suffix).html( "" );
  $('#MSG_SHOKEN'+suffix).html("");

  if(!file || !file.type.match(/^image\/(jpeg|jpg|jpe|png)$|application\/pdf/)) {
    return false;
  }

  var isPdf = Boolean(file.type.match(/application\/pdf/));

  var reader = new FileReader();
  if (isPdf) {
     /*
      *
      */
  }

【问题讨论】:

    标签: javascript jsp thumbnails pdf.js pdf.js.express


    【解决方案1】:

    将 ES6 转换为 Es5 并使用您想要的字符集

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-14
      • 2011-01-19
      • 1970-01-01
      • 2011-02-21
      • 2018-09-12
      • 2014-08-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多