從網路印表機列印 PDF 文件

This article was translated from English: Does it need improvement?
Translated
View the article in English

如何使用 IronPDF 從網路印表機列印?

IronPDF 支援 C# 中可用的所有列印選項。

傳送到預設印表機:

使用Print方法將 PDF 傳送到預設印表機。

IronPdf.PdfDocument.Print(System.Boolean)

// C# example of sending a PDF document to the default printer
using IronPdf;

var pdf = PdfDocument.FromFile("example.pdf");

// Sends the document to the default printer
pdf.Print(showPreview: false); // set `showPreview` to true to see a preview before printing
// C# example of sending a PDF document to the default printer
using IronPdf;

var pdf = PdfDocument.FromFile("example.pdf");

// Sends the document to the default printer
pdf.Print(showPreview: false); // set `showPreview` to true to see a preview before printing
$vbLabelText   $csharpLabel

傳送到指定的印表機:

使用重載的Print方法會依名稱指定印表機。

IronPdf.PdfDocument.Print(System.String, System.Boolean)

// C# example of sending a PDF document to a specific printer by name
using IronPdf;

var pdf = PdfDocument.FromFile("example.pdf");
string printerName = "MyNetworkPrinter";

// Sends the document to the specified printer
pdf.Print(printerName, showPreview: false);
// C# example of sending a PDF document to a specific printer by name
using IronPdf;

var pdf = PdfDocument.FromFile("example.pdf");
string printerName = "MyNetworkPrinter";

// Sends the document to the specified printer
pdf.Print(printerName, showPreview: false);
$vbLabelText   $csharpLabel

發現印表機:

若要將文件傳送至特定印表機,請確保已"發現"該印表機。

取得已安裝印表機的列表 如何取得電腦中所有印表機的列表

對於 AirPrint:

如果您使用 AirPrint,請嘗試以下建議:

您也可以嘗試: PdfDocument.GetPrintDocument()PdfDocument.Print重載,顯示列印預覽窗口,並且(如果可用)允許選擇 AirPrint。

柯蒂斯·週
技術撰稿人

Curtis Chau擁有卡爾頓大學電腦科學學士學位,專長於前端開發,精通Node.js、TypeScript、JavaScript和React。他熱衷於打造直覺美觀的使用者介面,喜歡使用現代框架,並擅長撰寫結構清晰、視覺效果出色的使用者手冊。

除了開發工作之外,柯蒂斯對物聯網 (IoT) 也抱有濃厚的興趣,致力於探索硬體和軟體整合的創新方法。閒暇時,他喜歡玩遊戲和製作 Discord 機器人,將他對科技的熱愛與創造力結合。

準備好開始了嗎?
Nuget 下載 17,012,929 | 版本: 2025.12 剛剛發布