Drukowanie plików PDF z drukarek sieciowych

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

Jak używać IronPDF do drukowania na drukarce sieciowej?

IronPDF obsługuje wszystkie opcje drukowania dostępne w języku C#.

Wyślij do domyślnej drukarki:

Użyj metody Print, aby wysłać PDF do domyślnej drukarki.

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
' C# example of sending a PDF document to the default printer
Imports IronPdf

Private 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

Wyślij do określonej drukarki:

Użyj przeciążonej metody Print, aby określić drukarkę według nazwy.

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);
' C# example of sending a PDF document to a specific printer by name
Imports IronPdf

Private pdf = PdfDocument.FromFile("example.pdf")
Private printerName As String = "MyNetworkPrinter"

' Sends the document to the specified printer
pdf.Print(printerName, showPreview:= False)
$vbLabelText   $csharpLabel

Odkryj drukarki:

Aby wysłać dokument do konkretnej drukarki, upewnij się, że została ona "wykryta".

W przypadku AirPrint:

W przypadku korzystania z AirPrint wypróbuj następujące sugestie:

Możesz również spróbować: Przeciążenia PdfDocument.GetPrintDocument() lub PdfDocument.Print, które pokazują okno podglądu wydruku i, jeśli dostępne, pozwolą na wybranie AirPrint.

Curtis Chau
Autor tekstów technicznych

Curtis Chau posiada tytuł licencjata z informatyki (Uniwersytet Carleton) i specjalizuje się w front-endowym rozwoju, z ekspertką w Node.js, TypeScript, JavaScript i React. Pasjonuje się tworzeniem intuicyjnych i estetycznie przyjemnych interfejsów użytkownika, Curtis cieszy się pracą z nowoczesnymi frameworkami i tworzeniem dobrze zorganizowanych, atrakcyjnych wizualnie podrę...

Czytaj więcej
Gotowy, aby rozpocząć?
Nuget Pliki do pobrania 18,135,201 | Wersja: 2026.4 just released
Still Scrolling Icon

Wciąż przewijasz?

Czy chcesz szybko dowodu? PM > Install-Package IronPdf
Uruchom przykład i zobacz, jak Twój kod HTML zamienia się w plik PDF.