> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/xamarin/guides/features/print/printer.md).

# Print a PDF to a printer in Xamarin

Learn how to print a PDF to a default printer with full sample code. This guide illustrates how to easily print a PDF document using the default printer. The Apryse Xamarin SDK streamlines secure, ser

To print a PDF to a default printer.

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
PDFDoc pdfdoc = new PDFDoc(filename);

// Setup PrinterMode options
PrinterMode printerMode = new PrinterMode();
printerMode.SetCollation(true);
printerMode.SetCopyCount(1);
printerMode.SetDPI(600); // regardless of ordering, an explicit DPI setting overrides the OutputQuality setting
printerMode.SetDuplexing(PrinterMode.DuplexMode.e_Duplex_Auto);

// Print the document on the default printer, name the print job the name of the
// file, print to the printer not a file, and use printer options:
Print.StartPrintJob(pdfdoc, "", pdfdoc.GetFileName(), "", null, printerMode, null);
```

{% endcode %}
{% endtab %}
{% endtabs %}

[Print a PDF file](/xamarin/get-started/samples.md#pdfprint) Full sample code which illustrates how to print a PDF document using the currently selected default printer.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.apryse.com/xamarin/guides/features/print/printer.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
