我正在尝试将一些 PDF 文件转换为 PDF/X-1A 格式。我已经在 Acrobat 中创建了一个操作来执行此操作,并且每当使用当前进程创建新的 PDF 文件时,我都希望从 NodeJS 调用此操作。然后我想将转换后的文件返回给用户。似乎没有任何其他解决方案可以像 Acrobat Pro 那样转换/压缩 PDF,因此这就是我寻求此选项的原因。
我的流程基本上如下:
genPdf:function(content,cb){
// Config for PDF generation, etc
// ...
pdfGenerator.doConversion(config, pdfPath, function(result) {
// After file is generated, I want to call my adobe action
var cmd = 'call_adobe_acrobat_action_cmd';
exec(cmd, function(error, stdout, stderr) {
// After action is called I'll initiate a watch on the directory that the action will write the converted file to
// When conversion has completed, I will serve the converted file back to the user
});
}
}
最佳答案
以这种方式使用它实际上违反了 Acrobat 许可协议(protocol)。 Acrobat 操作可以处理多个文件,但操作需要由用户触发。
查看 pdfToolbox Server,以实现从 PDF 到 PDF/X 的服务器端自动转换。
关于node.js - 从命令行 (NodeJS) 运行 Adobe Acrobat 操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42956384/