有没有办法使用 JavaScript 或 jquery 将 pdf 文件转换为 html 文件?这可以在客户端完成并在本地运行吗?
到目前为止,我只找到了像 pdf2htmlEX 这样的服务器端解决方案
也许有图书馆?
最佳答案
我认为只有在nodejs中。您可以运行
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);
});
或者,使用 this software这很容易从命令行使用。
关于javascript - 在客户端的 JavaScript/jquery 中将 pdf 文件转换为 html 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37441711/