---
title: "Printing PDF to specific printer | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/print/to-specific-printer/"
md_url: "https://www.nutrient.io/guides/dotnet/print/to-specific-printer.md"
last_updated: "2026-05-15T19:10:04.996Z"
description: "Discover how to print to a specific printer using .NET. Follow our guide for effective printing solutions tailored to your needs."
---

# Printing PDFs to a specific printer in C#

This guide explains how to print a PDF document or an image to a specific printer with Nutrient.NET SDK (formerly GdPicture.NET).

Printing and scanning aren’t supported in the cross-platform.NET 6.0 assembly. For more information, see the [system compatibility](/guides/dotnet/about/system-compatibility.md)  guide.

## Printing a PDF document

To print a PDF document to a specific printer, follow these steps:

1. Create a `GdPicturePDF` object.

2. Load the source document by passing its file path to the `LoadFromFile` method.

3. Optional: Enable the printer settings dialog by storing the handle of the active windows in a variable and then passing this variable to the `PrintShowPrinterSettingsDialog` method. To print silently, skip this step.

4. Select the printer to use by passing its name to the `PrintSetActivePrinter` method.

3. Optional: Configure the printing process programmatically. For more information, see the [configuring printing](https://www.nutrient.io/guides/dotnet/print/configuring-printing.md) guide.

4. Print the document with the `Print` method.

5. Release unnecessary resources.

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
// Load the source document.
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Store the handle of the active window in a variable.
IntPtr WINDOW_HANDLE = IntPtr.Zero;
// Enable the printer settings dialog.
gdpicturePDF.PrintShowPrinterSettingsDialog(WINDOW_HANDLE);
// Set `printer1` as the active printer.
gdpicturePDF.PrintSetActivePrinter("printer1");
// Print the document.
gdpicturePDF.Print();
// Release unnecessary resources.
gdpicturePDF.CloseDocument();

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    ' Load the source document.
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Store the handle of the active window in a variable.
    Dim WINDOW_HANDLE = IntPtr.Zero
    ' Enable the printer settings dialog.
    gdpicturePDF.PrintShowPrinterSettingsDialog(WINDOW_HANDLE)
    ' Set `printer1` as the active printer.
    gdpicturePDF.PrintSetActivePrinter("printer1")
    ' Print the document.
    gdpicturePDF.Print()
    ' Release unnecessary resources.
    gdpicturePDF.CloseDocument()
End Using

```

#### Used methods

- [`CloseDocument`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~CloseDocument.html)

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~LoadFromFile.html)

- [`Print`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~Print.html)

- [`PrintShowPrinterSettingsDialog`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~PrintShowPrinterSettingsDialog.html)

- [`PrintSetActivePrinter`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~PrintSetActivePrinter.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)

## Printing an image

To print an image to a specific printer, follow these steps:

1. Create a `GdPictureImaging` object.

2. Load the source document by passing its file path to the `CreateGdPictureImageFromFile` method.

3. Optional: Enable the printer settings dialog by storing the handle of the active windows in a variable and then passing this variable to the `PrintShowPrinterSettingsDialog` method. To print silently, skip this step.

4. Select the printer to use by passing its name to the `PrintSetActivePrinter` method.

5. Optional: Configure the printing process programmatically. For more information, see the [configuring printing](https://www.nutrient.io/guides/dotnet/print/configuring-printing.md) guide.

6. Print the image with the `Print` method.

7. Release unnecessary resources.

### C#

```csharp

using GdPictureImaging gdpictureImaging = new GdPictureImaging();
// Load the source image.
int imageId = gdpictureImaging.CreateGdPictureImageFromFile(@"C:\temp\source.png");
// Store the handle of the active window in a variable.
IntPtr WINDOW_HANDLE = IntPtr.Zero;
// Enable the printer settings dialog.
gdpictureImaging.PrintShowPrinterSettingsDialog(WINDOW_HANDLE);
// Set `printer1` as the active printer.
gdpictureImaging.PrintSetActivePrinter("printer1");
// Print the image.
gdpictureImaging.Print(imageId);
// Release unnecessary resources.
gdpictureImaging.ReleaseGdPictureImage(imageId);

```

### VB.NET

```vb

Using gdpictureImaging As GdPictureImaging = New GdPictureImaging()
    ' Load the source image.
    Dim imageId As Integer = gdpictureImaging.CreateGdPictureImageFromFile("C:\temp\source.png")
    ' Store the handle of the active window in a variable.
    Dim WINDOW_HANDLE = IntPtr.Zero
    ' Enable the printer settings dialog.
    gdpictureImaging.PrintShowPrinterSettingsDialog(WINDOW_HANDLE)
    ' Set `printer1` as the active printer.
    gdpictureImaging.PrintSetActivePrinter("printer1")
    ' Print the image.
    gdpictureImaging.Print(imageId)
    ' Release unnecessary resources.
    gdpictureImaging.ReleaseGdPictureImage(imageId)
End Using

```

#### Used methods

- [`Dispose`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPictureImaging~Dispose.html)

- [`CreateGdPictureImageFromFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~CreateGdPictureImageFromFile.html)

- [`Print`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~Print.html)

- [`PrintShowPrinterSettingsDialog`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~PrintShowPrinterSettingsDialog.html)

- [`PrintSetActivePrinter`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~PrintSetActivePrinter.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)
---

## Related pages

- [Configuring the printing process in C#](/guides/dotnet/print/configuring-printing.md)
- [Print PDF or images using C#](/guides/dotnet/print.md)
- [Printing PDFs programmatically in C#](/guides/dotnet/print/programmatic.md)
- [Printing PDFs silently in C#](/guides/dotnet/print/silently.md)
- [Printing PDFs to a network printer in C#](/guides/dotnet/print/to-network-printer.md)
- [UI control for PDF printing](/guides/dotnet/print/ui-control.md)
- [PDF printing with watermarks in C#](/guides/dotnet/print/with-watermark.md)

