简体   繁体   English

使用Acrobat自动保存PDF

[英]Automate saving a PDF with Acrobat

We have a program that processes PDF documents - Automated. 我们有一个处理PDF文档的程序-自动化。 We fail with certain PDFs because they are malformed . 我们无法处理某些PDF,因为它们格式错误。 When we open the PDFs in acrobat, it opens it. 当我们在acrobat中打开PDF时,它将打开它。 I see that Acrobat goes to extra measures to fix the malformed PDFs. 我看到Acrobat采取了其他措施来修复格式错误的PDF。 So in our case, someone manually has to open and save them to make them clean. 因此,在我们的情况下,必须手动打开并保存它们以使其干净。 Is there a way I can programmatically do this in Python or Powershell? 有什么方法可以在Python或Powershell中以编程方式执行此操作吗? Has anyone done this? 有人这样做吗?

Thanks! 谢谢!

You might try this this link. 您可以尝试此链接。

You can run a macro from powershell. 您可以从powershell运行宏。 You can also set up a scheduled task to run your powershell script in task scheduler at pretty much any interval you like (TASKSCHD.MSC) This particular example has a msgbox for the path to folder but it loops through all pdf files in a folder, flattens and saves. 您还可以设置一个计划任务,以几乎任意间隔在任务计划程序中运行Powershell脚本(TASKSCHD.MSC)。这个特定的示例具有一个指向文件夹路径的msgbox,但它会循环遍历文件夹中的所有pdf文件,变平并保存。 Perhaps flattening might not be required but might help with a malformed PDF. 也许不需要拼合,但对于格式错误的PDF可能会有所帮助。

** This relies on Acrobat and uses the javascript API through the excel ... I'm not sure if libreoffice draw has has a javascript api like acrobat. **这依赖于Acrobat并通过excel使用javascript API ...我不确定libreoffice draw是否具有acrobat之类的javascript API。 I'm not aware of any open source alternatives that have that sort of functionality. 我不知道具有这种功能的任何开源替代品。 If anyone is please let me know. 如果有人,请告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM