从 .net 中的应用程序批量打印?
我正在为我的公司 Intranet 开发一个项目,该项目需要在后台自动打印项目主 DTO 的多个附加文档。问题是它是一个网络项目,我希望打印在表面下完成。现在,因为它位于 Intranet 上,只有某些人可以使用它,而且我可以在后台设置一台公用打印机,但我想知道如何在表面下实际打印,附件可以是从影印 gifs/jpegs 到 pdf/word 文档的任何内容。我应该使用 PrintDocument 类吗?不太确定如何实现这一点。为任何帮助干杯
I'm working on a project for my companies intranet which requires that multiple attached documents to the main DTO of the project need to be autoprinted in the background. The problem is it's a web project and I want the printing to be done under the surface. Now because it's on an intranet only certain people can use it and I can set a communal printer in the background but I'm wondering hwo to actually print under the surface, the attachments could be anything from photocopy gifs/jpegs to pdf/word docs. Should I use the PrintDocument class? Not really sure how to implement this one. Cheers for any help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找不到一种方法来做到这一点,所以我所做的就是编写一个类,使用 OpenOfficePortable 将所有文件合并到一个 pdf 中,然后通过文件流将批量打印的 pdf 返回给用户。对于任何感兴趣的人此处 是一篇帮助您入门的文章,它将 rtf、doc、docx 文件转换为 pdf。然后使用ITextSharp或类似的pdf库合并文件并返回。如果您正在尝试此操作但遇到问题,请私信我。
I couldn't find a way to do it under the hood as such so what I did instead was to write a class that merges all the files together into one pdf using OpenOfficePortable and then returned this bulk-print pdf to user via a file stream. For anyone interested here is an article that'll help you get started, it will convert rtf, doc, docx files to pdf. Then use ITextSharp or a similar pdf library to merge the files and return it. Pm me if you're attempting this and having trouble.