我有一个文件输入,在“上传”之前我需要在JAVASCRIPT(例如JQuery...)中计算该.pdf的页数 最佳答案 如果您使用pdf.js,您可以引用exampleongithub('.../examples/node/getinfo.js')使用以下代码打印pdf文件中的页数。constpdfjsLib=require('pdfjs-dist');...pdfjsLib.getDocument(pdfPath).then(function(doc){varnumPages=doc.numPages;console.log('#