Printing PDFs from Network Printers

This article was translated from English: Does it need improvement?
Translated
View the article in English
role="alert"> IronPrint est la toute nouvelle bibliothèque d'impression .NET d'Iron Software, offrant une compatibilité sur une large gamme de plateformes, y compris Windows, macOS, Android et iOS. Commencez avec IronPrint maintenant !

Comment utiliser IronPDF pour imprimer à partir d'une imprimante réseau ?

IronPDF prend en charge toutes les options d'impression disponibles pour C#.

Envoyer à une imprimante par défaut :

Utilisez la méthode Print pour envoyer le PDF à l'imprimante par défaut.

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

Envoyer à une imprimante nommée :

Utilisez la méthode surchargée Print pour spécifier l'imprimante par nom.

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

Découvrir les imprimantes :

Pour envoyer le document à une imprimante spécifique, assurez-vous que l'imprimante est 'découverte'.

Pour AirPrint :

Essayez les suggestions suivantes si vous utilisez AirPrint :

Vous pouvez également essayer : PdfDocument.GetPrintDocument() ou les surcharges de PdfDocument.Print, qui affichent la fenêtre d'aperçu avant impression et, si disponible, permettront de sélectionner AirPrint.

Curtis Chau
Rédacteur technique

Curtis Chau détient un baccalauréat en informatique (Université de Carleton) et se spécialise dans le développement front-end avec expertise en Node.js, TypeScript, JavaScript et React. Passionné par la création d'interfaces utilisateur intuitives et esthétiquement plaisantes, Curtis aime travailler avec des frameworks modernes ...

Lire la suite
Prêt à commencer?
Nuget Téléchargements 16,154,058 | Version : 2025.11 vient de sortir