简体   繁体   English

需要从.net打印PDF并选择不同的纸盘进行输出

[英]Need to print a PDF from .net and select different trays for output

My company is moving to a new system which has a very poor printing system in place but it does create PDF's on the file system. 我的公司正在迁移到一个新系统,该系统的打印系统性能很差,但是确实在文件系统上创建了PDF。

My Boss has asked me to create an application to print all the PDF's based on a JOB number. 我的老板要求我创建一个应用程序,以根据作业号打印所有PDF。

I've gotten the filesystem search working, I have used the acrobat sdk to open each file and find certain strings to determine which pages go where. 我已使文件系统搜索正常工作,我已使用acrobat sdk打开每个文件并查找某些字符串以确定哪些页面位于何处。

The problem I'm dealing with is that the Acrobat SDK doesn't seem to support choosing printer settings. 我要解决的问题是Acrobat SDK似乎不支持选择打印机设置。

My first thought was no big deal I just change the default windows printer and just change the tray so the invoice part and equipment listing go to white paper from tray 1, and the remittance goes to tray 2 on blue paper. 我最初的想法没什么大不了,我只是更改了默认的Windows打印机并仅更改了纸盘,因此发票部件和设备清单从纸盘1移到了白纸,而汇款在蓝纸上移到了纸盘2。

It seems like the printdocument in .net can handle alot of printer settings but I'm not sure if a PDF can be used with a print document. 似乎.net中的printdocument可以处理许多打印机设置,但是我不确定PDF是否可以与打印文档一起使用。

Looking for any advice or assistance. 寻找任何建议或帮助。

Thanks, 谢谢,

Joshua 约书亚记

I found the answer was to use Win32. 我发现答案是使用Win32。

Here was the website that helped me get through some of the hurdles: 这是帮助我克服一些障碍的网站:

http://edinkapic.blogspot.com/2011/01/how-to-set-printer-default-paper-bin-in.html http://edinkapic.blogspot.com/2011/01/how-to-set-printer-default-paper-bin-in.html

The underlying problem is that PDFs are combination of vector graphics for the text and bitmapped images. 潜在的问题是PDF是文本和位图图像的矢量图形的组合。 It all needs to be rendered into a format the printer understands before being printable. 必须先将其渲染成打印机可以理解的格式。

Ghostscript does this very nicely and if you need to do it from .Net, GhostScript.Net provides an excellent vb.Net interface. Ghostscript可以很好地做到这一点,如果您需要从.Net做到这一点,GhostScript.Net提供了一个出色的vb.Net界面。

The problem I'm dealing with is that the Acrobat SDK doesn't seem to support choosing printer settings. 我要解决的问题是Acrobat SDK似乎不支持选择打印机设置。

You can't use the desktop version of Acrobat for this, since it's not designed for unattended operation and requires a user interface. 您不能为此使用Acrobat的桌面版本,因为它不是为无人值守的操作而设计的,并且需要用户界面。 Also, I believe it violates Adobe's license. 另外,我认为它违反了Adobe的许可。

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

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