0
我正在构建一个主要功能是打印.pdf文件的应用程序。 我搜索了很多,并找不到我需要的东西,所以这里是我的问题。VB.net - 用纸张大小的打印机打印pdf文件
我想创建一个方法,用选定的打印机和纸张尺寸打印.pdf文件。 (我们有一台绘图仪,从A0到A3图纸),因此批量中可以有不同大小的大范围。
Public Sub print_pdf(byval document as string, byval printer as string, byval size as string)
我发现这个类似的帖子,但..它写在c#
,我不能读它..我只熟悉vb.net。
我们所有的电脑都配备了Acrobat Reader软件,但如果是打印一个更好的方法?我接受建议!
请帮助..我卡住了!
我也发现了这个示例代码c#
string path = "" <- your path here.
if (path.EndsWith(".pdf"))
{
if (File.Exists(path))
{
ProcessStartInfo info = new ProcessStartInfo();
info.Verb = "print";
info.FileName = path;
info.CreateNoWindow = true;
info.WindowStyle = ProcessWindowStyle.Hidden;
Process p = new Process();
p.StartInfo = info;
p.Start();
p.WaitForInputIdle();
System.Threading.Thread.Sleep(3000);
if (false == p.CloseMainWindow())
p.Kill();
}
}
从this后。有没有办法空闲,直到打印队列完成?然后打印一个杀死进程?
可能的复制[在VB.net中打印外部PDF文档](http://stackoverflow.com/questions/26970825/printing-an-external-pdf-document-in-vb-net) – ChristopheD