Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在JSP页面中显示PDF缩略图_Javascript_Jsp_Thumbnails_Pdf.js_Pdf.js.express - Fatal编程技术网

Javascript 如何在JSP页面中显示PDF缩略图

Javascript 如何在JSP页面中显示PDF缩略图,javascript,jsp,thumbnails,pdf.js,pdf.js.express,Javascript,Jsp,Thumbnails,Pdf.js,Pdf.js.express,我尝试使用以下js,但似乎不可行。 我如何修复它? function dispPhoto(file,suffix) { var $thumbArea = $('#thumbnail'+suffix); $thumbArea.empty(); $('#fileName'+suffix).html( "" ); $('#MSG_SHOKEN'+suffix).html(""); if(!file || !file.type.match(

我尝试使用以下js,但似乎不可行。

我如何修复它?

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) {
     /*
      *
      */
  }