在C#中打印PDFPDF

2023-09-02 21:08:06 作者:不再畏惧

我是新来的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

Reading PDF内容与iTextSharp的在VB.NET或DLL C#

然后打印出来。如果是这样,怎么样?

then print it. If so, how?

推荐答案

一个非常简单的方法是使用一个安装Adobe 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