Impressão de PDFs em impressoras de rede

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

Como faço para usar o IronPDF para imprimir a partir de uma impressora de rede?

O IronPDF suporta todas as opções de impressão disponíveis em C#.

Enviar para uma impressora padrão:

Use o método Print para enviar o PDF para a impressora padrão.

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

Enviar para uma impressora específica:

Use o método sobrecarregado Print para especificar a impressora pelo nome.

IronPDF(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

Descubra as impressoras:

Para enviar o documento para uma impressora específica, certifique-se de que a impressora esteja "detectada".

Para AirPrint:

Se você usa o AirPrint, experimente as seguintes sugestões:

Você também pode tentar: PdfDocument.GetPrintDocument() ou sobrecargas PdfDocument.Print, que mostram a janela de pré-visualização de impressão e, se disponível, permitirão que o AirPrint seja selecionado.

Curtis Chau
Redator Técnico

Curtis Chau é bacharel em Ciência da Computação (Universidade Carleton) e se especializa em desenvolvimento front-end, com experiência em Node.js, TypeScript, JavaScript e React. Apaixonado por criar interfaces de usuário intuitivas e esteticamente agradáveis, Curtis gosta de trabalhar com frameworks modernos e criar manuais ...

Leia mais
Pronto para começar?
Nuget Downloads 18,318,263 | Versão: 2026.4 acaba de ser lançado
Still Scrolling Icon

Ainda está rolando a tela?

Quer provas rápidas? PM > Install-Package IronPdf
executar um exemplo Veja seu HTML se transformar em um PDF.