> 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/print/print-document.md).

# Print

Learn how to print PDF documents in Xamarin.Android and Xamarin.iOS effortlessly with Apryse SDK. Follow simple steps to integrate printing functionality using Print.StartPrintJob and Print.PrintDoc.

Apryse SDK supports printing.

{% tabs %}
{% tab title="Android" %}

## Printing a PDF document in Xamarin.Android

The library handles all the hard work, you simply have to tell it to show the system print dialog with a document. This can be done with [`Print.StartPrintJob`](https://sdk.apryse.com/api/xamarinandroid/pdfnet/api/pdftron.PDF.Print.html#pdftron_PDF_Print_StartPrintJob_Context_String_pdftron_PDF_PDFDoc_String_System_Int32_System_Boolean_). Here is how:

{% code lineNumbers="true" %}

```csharp
void handlePrintJob(Activity activity, bool isRtl,
    bool printDocument,
    bool printDocumentWithAnnotations,
    bool printDocumentWithAnnotationSummary)
{
    var printContent = 0;
    if (printDocument)
    {
        printContent |= Print.PrintContent.DocumentBit;
    }
    if (printDocumentWithAnnotations)
    {
        printContent |= Print.PrintContent.AnnotationBit;
    }
    if (printDocumentWithAnnotationSummary)
    {
        printContent |= Print.PrintContent.SummaryBit;
    }
    Print.StartPrintJob(activity, activity.GetString(Resource.String.app_name), mPdfDoc, (int)printContent, isRtl);
}
```

{% endcode %}
{% endtab %}

{% tab title="iOS" %}

## Printing a PDF document in Xamarin.iOS

The library handles all the hard work, you simply have to tell it to show the system print dialog with a document. This can be done with [`Print.PrintDoc`](https://sdk.apryse.com/api/xamarinios/tools/api/pdftron.PDF.PTPrint.html#pdftron_PDF_PTPrint_PrintDoc_System_String_CoreGraphics_CGRect_UIKit_UIView_System_String_System_Boolean_UIKit_UIPrintInteractionCompletionHandler_). Here is how:

{% code lineNumbers="true" %}

```csharp
void handlePrintJob()
{
    pdftron.PDF.PTPrint print = new PTPrint();
    print.PrepareDocToPrint(mPdfDoc, new MyPrintDelegate(this.View), btnPrint as NSObject);
}
```

{% endcode %}

where `MyPrintDelegate` is:

{% code lineNumbers="true" %}

```csharp
public class MyPrintDelegate : pdftron.PDF.PTPrintDelegate
{
    private UIView _view;
    public MyPrintDelegate(UIView view) 
    {
        _view = view;
    }
    public override void PreparedToPrint(string docFilePath, NSObject userData)
    {
        var myPrint = new pdftron.PDF.PTPrint();
        myPrint.PrintDoc(docFilePath, CGRect.Empty, _view, docFilePath, true, null);
    }
}
```

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


---

# 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/print/print-document.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.
