脚本创建PDF [英] Scripting PDF Creation

查看:160
本文介绍了脚本创建PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在负责我们的远程自动化的一些报道的集合。机器有时会在本地由工作人员在该位置使用,其使用量是随机的。生成该报告的软件是有所限制,并且只允许我们打印到默认打印机。这是服用这些报告的部门不希望任何改变,他们喜欢让他们的PDF文件。

I've been tasked with automating the collection of some reports from our remote locations. The machines are sometimes used locally by the staff at the location, and their usage is random. The software that generates the reports is somewhat limited and just allows us to print to the default printer. The department that's taking these reports doesn't want anything to change, and they enjoy getting their PDFs.

我可以以编程方式更改为使用打印机的PDFCreator(并切换回去,这样工作人员在位置不会注意到)的默认打印机,我可以通过编程生成报告并将其发送到打印机。

I can programmatically change the default printer to use the PDFCreator printer (and switch it back so the staff at the location won't notice), and I can programmatically generate the report and send it to printer.

我的问题是,这样做从PDFCreator的想要的文件名和一些元数据用于PDF弹出一个窗口。

My problem is that doing so pops up a window from PDFCreator wanting a file name and some meta-data for the PDF.

我想,以尽量减少窗口弹出,并希望让我为不干扰本地用户尽可能的报告聚会。

I'd like to minimize the windows popping up, and hopefully make my gathering of the reports as unobtrusive to the local users as possible.

有没有一种简单的方法来自动的PDFCreator互动,还是我留下了使用SendMessage函数(或类似),并模拟用户交互?

不是必需的PDFCreator,我还建议采取其他PDF印刷型件软件,解决了这个问题了。

PDFCreator isn't required, I'd also take suggestions for other PDF-print-type pieces of software that solves this problem, too.

推荐答案

的PDFCreator是一个用VB包装一轮的ghostscript所以你应该能够修改的PDFCreator不弹出对话框,并给它一些其他的方式的文件名。

PDFCreator is a VB wrapper round ghostscript so you should be able to modify PDFCreator to not pop the dialog up and give it the filename in some other way.

另外,您可以使用带有指向FILE输出PostScript打印机驱动程序:然后你就可以以编程方式调用的ghostscript到PS转换为PDF自己。我看不到的方式来阻止时,端口设置为文件创建对话框窗口内置的PostScript驱动程序:当端口设置为psfile中我想不通所在的文件去。然而 GSPSprinter.html 对如何建立一个Ghostscript的后记说明打印机固定的文件位置,所以你应该让无对话框。

Alternatively you could use a postscript printer driver with output directed to FILE: and then you can programmatically call ghostscript to convert the PS to PDF yourself. I can't see a way to stop the windows built-in postscript drivers from creating a dialog when port is set to FILE: and when port is set to PSFile I can't figure out where the file goes. However GSPSprinter.html has instructions for how to set up a Ghostscript postscript printer to a fixed file location so you should get no dialogs.

这篇关于脚本创建PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆