Printing PDF files in Xamarin Pdf Viewer (SfPdfViewer)

PDF Viewer allows printing the loaded PDF documents using the Print button in the built-in toolbar.

Print PDF file using SfPdfViewer

The Print operation could be performed using the following APIs programmatically.

//Print the PDF
pdfViewerControl.Print();

//Print the PDF with given file name
pdfViewerControl.Print(string filename);

The following example demonstrates the usage of print operation within a button click event.

private void Button_Clicked(object sender, EventArgs e)
{
	//Print the PDF
    pdfViewerControl.Print("PdfFileName.pdf");
}

NOTE

The default file name of the printed document will be “SavedDocument.pdf”.