有没有一种使用JavaScript或jquery将pdf文件转换为html文件的方法?这可以在客户端上完成并在本地运行吗?
到目前为止,我只发现了像pdf2htmlEX这样的服务器端解决方案。
也许有库可以实现?
有没有一种使用JavaScript或jquery将pdf文件转换为html文件的方法?这可以在客户端上完成并在本地运行吗?
到目前为止,我只发现了像pdf2htmlEX这样的服务器端解决方案。
也许有库可以实现?
我认为只有在Node.js中才能实现。您可以运行
npm install pdftohtmljs
然后在您的服务器代码中:
var pdftohtml = require('pdftohtmljs');
var converter = new pdftohtml('file.pdf', "file.html");
// see https://github.com/fagbokforlaget/pdftohtmljs/blob/master/lib/presets/ipad.js
converter.convert('ipad').then(function() {
console.log("converted");
}).catch(function(err) {
console.log(err);
});
或者,使用这个软件,它可以轻松地从命令行中使用。
和 GitHub 仓库