打印PDF文件以改变默认的打印机设置 [英] Printing PDFs with changed default printer settings

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

问题描述

谷歌/冰didnt带来的任何解决方案,我以下的问题,希望有人能帮助我:

Google/Bing didnt bring up any solution to my following problem, hope someone can help me:

我们必须在我们的基于C#程序打印各种PDF文件。在我们可以打印,我们要配置的打印机,如设置方向为横向。

We have to print various PDF files in our C# based program. Before we can print, we have to configure the printer, e.g. setting the orientation to landscape.

我试图改变默认的打印机设置,例如,像这样的:

I tried to change the default printer settings e.g. like this:

PrinterSettings settings = new PrinterSettings();
settings.PrinterName = "\\\\SomeNetworkPrinter\\";
settings.DefaultPageSettings.Landscape = true;
settings.Duplex = Duplex.Horizontal;

我们发送PDF通过PDFSharp,基本上工作了打印机,但我的设置完全地忽略。是不是有可能改变默认的打印机设置这种方式?我们是否有任何机会,以更改设置并打印了PDF格式的文件吗?

We send the PDF to the printer via PDFSharp, which basically works, but my settings are completly ignored. Isn't it possible to change the default printer settings this way? Do we have any chance to change the settings and print our PDF-files?

非常感谢你提前!

推荐答案

要回答我的问题...

To answer my own question ...

在试错我不认为有任何机会,以通过配置.NET和打印PDF文件打印后的3天。你不能使用System.Drawing.Printing.PrintDocument类结合PDF文件,但使用的PrintDocument似乎是prerequisit更改打印机设置。

After 3 days of trial and error I dont think there is any chance to configure the printer via .NET and print PDFs afterwards. You cant use the System.Drawing.Printing.PrintDocument class in combination with PDFs, but using PrintDocument seems to be a prerequisit to change the printer settings.

我的解决方案来配置打印机的灵感来自于这个职位上codePLEX:的 HTTP://www.$c$cproject.com/KB/dotnet/NET_Printer_Library.aspx

My solution to configure the printer was inspired by this post on codeplex: http://www.codeproject.com/KB/dotnet/NET_Printer_Library.aspx

要最后打印我通过命令行参数到Adobe Reader发送的PDF格式。

To finally print the pdf I send it via commandline parameters to Adobe Reader.

这篇关于打印PDF文件以改变默认的打印机设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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