在 C# 中打印 PDF [英] Print Pdf in C#

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

问题描述

我是 C# 的新手.我在网上到处寻找有关如何打印 pdf 的教程,但找不到.

I'm new to c#. I was looking all over the net for tutorials on how to print pdf, but couldn't find one.

然后我想,是否可以使用 itextpdf 阅读它,就像这里提到的那样

Then I thought, is it possible to read it using itextpdf, like mentioned here

使用 itextsharp dll 读取 PDF 内容VB.NET 或 C#

然后打印出来.如果是,怎么办?

then print it. If so, how?

推荐答案

一个非常直接的方法是使用已安装的 Adob​​e Reader 或任何其他能够打印的 PDF 查看器:

A very straight forward approach is to use an installed Adobe Reader or any other PDF viewer capable of printing:

Process p = new Process( );
p.StartInfo = new ProcessStartInfo( )
{
    CreateNoWindow = true,
    Verb = "print",
    FileName = path //put the correct path here
};
p.Start( );

另一种方法是使用第三方组件,例如PDFView4NET

Another way is to use a third party component, e.g. PDFView4NET

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

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