我没有成功找到一个节点模块或一些可以使用Node JS将PDF转换为doc / docx格式的代码。有什么办法吗?
答案 0 :(得分:1)
您可以使用Aspose.Words Cloud SDK for Node.js将npm的PDF转换为DOCX
const { WordsApi, SaveOptionsData } = require("asposewordscloud");
const { UploadFileRequest, SaveAsRequest }= require("asposewordscloud/dist/model/model");
var fs = require('fs');
# Please get your App Key and App SID from https://dashboard.aspose.cloud
wordsApi = new WordsApi("APP_KEY", "APP_SID");
const remotename = "02_pages.pdf";
const remoteTempFolder = "Temp";
const request = new SaveAsRequest({
saveOptionsData: new SaveOptionsData({
saveFormat: "docx",
fileName: "TestPostDocumentSavePdfAsDocx.docx",
}),
});
request.name = remotename;
request.folder = remoteTempFolder;
wordsApi.saveAs(request).then((result) => {
console.log(result.body);
}).catch(function(err) {
// Deal with an error
console.log(err);
});
我是aspose的开发人员。
答案 1 :(得分:0)