IRONSOFTWAREHOME
纸张打印 PDF
using IronPdf;

// Create a new PDF and print it
var renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");

// Send the PDF to the default printer to print
// 300 DPI, no user dialog this time ... many overloads to this method
pdf.Print(300);

//For advanced printing we can also use PdfDocument.GetPrintDocument
//Remember to add an assembly reference to System.Drawing.dll or System.Drawing.Common via NuGet.

System.Drawing.Printing.PrintDocument printDocYouCanWorkWith = pdf.GetPrintDocument();
Imports IronPdf

' Create a new PDF and print it
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf")

' Send the PDF to the default printer to print
' 300 DPI, no user dialog this time ... many overloads to this method
pdf.Print(300)

'For advanced printing we can also use PdfDocument.GetPrintDocument
'Remember to add an assembly reference to System.Drawing.dll or System.Drawing.Common via NuGet.

Dim printDocYouCanWorkWith As System.Drawing.Printing.PrintDocument = pdf.GetPrintDocument()
NuGet Download
PM > Install-Package IronPdf
纸张打印 PDF

纸张打印 PDF

上面的代码片段演示了如何在.NET中使用IronPdf库打印PDF文档。 它包括使用默认的Windows打印对话框或静默打印的选项,并展示了如何利用本地PrintDocument对象进行更高级的打印配置。 如果您要使用System.Drawing.dll的引用。

使用 IronPDF 探索高级打印技术
在 GitHub 上查看

准备开始了吗?

Nuget Downloads 20,809,720版本:2026.9刚刚发布

Key in blue circle

立即获取免费的 30 天试用版密钥

Your trial license will be sent to your email address

无任何限制。100% 解锁。无需信用卡。

bullet_checked无需信用卡或创建账户无任何限制。100% 解锁。无需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
预约您的免费现场演示
Booking Badge

深受全球数百万工程师信赖

Iron Software 的客户徽标
获取您的无义务咨询
填写下面的表格或通过sales@ironsoftware.com
您的资料将始终保密。
深受全球数百万工程师信赖
Iron Software 的客户徽标
立即获取您的免费30 天试用密钥
无需信用卡或创建账户