This is a migrated thread and some comments may be shown as answers.

Printing PDF in UWP app

2 Answers 637 Views
PdfViewer
This is a migrated thread and some comments may be shown as answers.
Neil N
Top achievements
Rank 2
Iron
Iron
Veteran
Neil N asked on 16 Dec 2020, 04:19 PM
Once we display the PDF in the viewer, how can the user to print it in a UWP app?

2 Answers, 1 is accepted

Sort by
0
Accepted
Lance | Senior Manager Technical Support
Telerik team
answered on 16 Dec 2020, 05:14 PM

Hello Neil,

You must implement this yourself on the native platform using a Dependency Service. Specifically, you would implement the UWP Printing APIs in a DependencyService.

You can find the code to print on UWP here Windows-universal-samples/Samples/Printing at master ยท microsoft/Windows-universal-samples (github.com)

Tutorial and Example

If you are not familiar with using DependencyService in Xamarin.Forms, I strongly recommend that you spend 30 minutes on this tutorial before moving forward. https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/dependency-service/introduction

Once you're done with that tutorial and understand where to put the files (or you are already familiar with DependencyServices) you can review the code in this gist to implement your own service Xamarin.Forms PDF Printing Dependency Service (github.com)

Important - Note that code is a head start, compiled from different open-source sources from forums and StackOverflow and is not intended for production. You should do thorough testing before even considering it ready for your app users.

Feature Request

We do have a Feature Request open for building in Print capability right into the viewer Share PDF for print, email, text, etc (telerik.com)

I have already upvoted it on your behalf. If you would like to be notified of status changes, please click the "Follow" button.

Further Assistance

I hope this helps!

Regards,
Lance | Manager Technical Support
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Neil N
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 06 Jan 2021, 07:17 PM
Thanks Lance, very helpful.
Tags
PdfViewer
Asked by
Neil N
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Lance | Senior Manager Technical Support
Telerik team
Neil N
Top achievements
Rank 2
Iron
Iron
Veteran
Share this question
or