默默打印PDF与Acrobat [英] Printing a PDF Silently with Adobe Acrobat

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

问题描述

我试图使用Adobe Acrobat C#默默打印PDF时,有2个问题。我用打印的Process.Start PDF文件()。

I'm having 2 issues when trying to print a pdf silently in C# using adobe acrobat. I'm printing the pdfs using Process.Start().

第一个问题是,我无法不指定为可执行文件的完整路径推出的Adobe Acrobat。我认为当你安装它不将其添加到您的路径。 有一个简单的方法来启动一台机器上杂技演员的最新版本,而无需指定全路径名?我担心客户会做一个更新,打破我的code,会启动这个。我也关注他们对不同版本的Windows的计算机上安装这个(安装路径是在64位环境与32位不同)。

The first issue is that I cannot launch Adobe Acrobat without specifying the full path to the executable. I assume it doesn't add it to your path when you install it. Is there an easy way to launch the newest version of acrobat on a machine without specifying full path names? I'm worried that the client is going to do an update and break my code that launches this. I'm also concerned with them installing this on machines with different versions of windows (install paths are different in 64 bit environment vs. 32 bit).

我的第二个问题是,每当我启动Acrobat并打印仍有Acrobat窗口打开的事实。我以为我是用命令行参数也要喝preSS这一切,但显然不是。

My second problem is the fact that whenever I launch acrobat and print it still leaves the acrobat window open. I thought that the command line parameters I was using would suppress all of this but apparently not.

我想从以下语法从命令行启动安装Adobe Acrobat:

I'm trying to launch adobe acrobat from the command line with the following syntax:

C:\\ Program Files文件(x86)的\\的Adobe \\读卡器10.0 \\读卡器> AcroRd32.exe / TLabel.pdfHP4000的HP LaserJet 4100系列PCL6out.pdf

据打印出不错,但它仍然留下Acrobat窗口了。 有除了走出去,编程杀死进程?

It prints out fine but it still leaves the acrobat window up. Is there any other solution besides going out and killing the process programmatically?

推荐答案

我在这里结束了对救助Adobe Acrobat和用的福昕阅读器(免费PDF阅读器)做我的PDF打印。这是code我使用福昕通过在C#打印:

I ended up bailing on Adobe Acrobat here and going with FoxIt Reader (Free pdf reader) to do my pdf printing. This is the code I'm using to print via FoxIt in C#:

Process pdfProcess = new Process();
pdfProcess.StartInfo.FileName = @"C:\Program Files (x86)\Foxit Software\Foxit Reader\Foxit Reader.exe";
pdfProcess.StartInfo.Arguments = string.Format(@"-p {0}", fileNameToSave);
pdfProcess.Start();

以上code打印到默认打印机,但也有命令行参数,你可以用它来指定文件和打印机。您可以使用下面的语法:

The above code prints to the default printer but there are command line parameters you can use to specify file and printer. You can use the following syntax:

福昕Reader.exe -tPDF文件名,打印机名称

Foxit Reader.exe -t "pdf filename" "printer name"

显然早期版本杂技演员不必上述任一概述的问题。如果你使用一个更旧的版本(4.x或类似的东西)就不会出现这个问题。

Apparently earlier versions of acrobat do not have the problem outlined above either. If you use a much older version (4.x or something similar) it does not exhibit this problem.

有些打印机都支持本机PDF打印以及因此它可能将原始PDF数据发送到打印机,它可能打印。请参见 https://support.microsoft.com/en-us/kb/322091原始数据发送到打印机。

Some printers do support native pdf printing as well so it's possible to send the raw pdf data to the printer and it might print it. See https://support.microsoft.com/en-us/kb/322091 for sending raw data to the printer.

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

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