{"id":26086886,"url":"https://github.com/pspdfkit/xamarin-uwp","last_synced_at":"2025-04-12T03:23:19.618Z","repository":{"id":48117919,"uuid":"122213618","full_name":"PSPDFKit/Xamarin-UWP","owner":"PSPDFKit","description":"Xamarin example app for PSPDFKit for Windows UWP. (Windows PDF SDK)","archived":false,"fork":false,"pushed_at":"2024-10-29T09:02:47.000Z","size":2777,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-10-29T10:56:47.432Z","etag":null,"topics":["forms-uwp","pdf","pdf-viewer","pspdfkit","sdk","uwp","xamarin"],"latest_commit_sha":null,"homepage":"http://pspdfkit.com","language":"C#","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PSPDFKit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-20T15:05:04.000Z","updated_at":"2024-10-29T09:02:52.000Z","dependencies_parsed_at":"2024-05-17T09:33:02.730Z","dependency_job_id":"67fa0e1e-fa61-481f-9d01-7ddd6babbac0","html_url":"https://github.com/PSPDFKit/Xamarin-UWP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSPDFKit%2FXamarin-UWP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSPDFKit%2FXamarin-UWP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSPDFKit%2FXamarin-UWP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSPDFKit%2FXamarin-UWP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PSPDFKit","download_url":"https://codeload.github.com/PSPDFKit/Xamarin-UWP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248510804,"owners_count":21116278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["forms-uwp","pdf","pdf-viewer","pspdfkit","sdk","uwp","xamarin"],"created_at":"2025-03-09T07:18:45.845Z","updated_at":"2025-04-12T03:23:19.596Z","avatar_url":"https://github.com/PSPDFKit.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xamarin.Forms UWP Sample\n\n#### PSPDFKit\n\nThe [PSPDFKit SDK](https://pspdfkit.com/) is a framework that allows you to view, annotate, sign, and fill PDF forms on iOS, Android, Windows, macOS, and Web.\n\n[PSPDFKit Instant](https://pspdfkit.com/instant) adds real-time collaboration features to seamlessly share, edit, and annotate PDF documents.\n\n#### Related\n\n- Xamarin.Android Bindings for PSPDFKit for Android: [PSPDFKit/Xamarin-Android](https://github.com/PSPDFKit/Xamarin-Android)\n- Xamarin.iOS Bindings for PSPDFKit for iOS: [PSPDFKit/Xamarin-iOS](https://github.com/PSPDFKit/Xamarin-iOS)\n\n\u003e [!NOTE] \n\u003e - Nutrient Xamarin SDK (formerly PSPDFKit Xamarin for iOS and PSPDFKit Xamarin for Android) is being sunset and replaced by \u003ca href='https://www.nutrient.io/guides/ios/dotnet/'\u003eNutrient .NET for iOS\u003c/a\u003e and \u003ca href='https://www.nutrient.io/guides/android/dotnet/'\u003eNutrient .NET for Android\u003c/a\u003e. All Nutrient Xamarin licenses will remain valid and fully supported until 1 December 2025, or until your license expires, whichever occurs later.\n\u003e - Nutrient UWP SDK (formerly PSPDFKit for Windows) is being sunset, in line with \u003ca href='https://learn.microsoft.com/en-us/windows/apps/get-started/windows-developer-faq#deprecations-and-migrations'\u003eMicrosoft’s decision\u003c/a\u003e to gradually phase out UWP by limiting updates to bug fixes and security patches. All Nutrient UWP licenses will continue to work and be supported until 1 December 2026, or until your license expires, whichever occurs later.\n\u003e\n\u003e Interested in transitioning to another Nutrient product? \u003ca href='https://www.nutrient.io/company/contact'\u003eContact us\u003c/a\u003e and we’ll be happy to help.\n\n## Support, Issues and License Questions\n\nPSPDFKit offers support for customers with an active SDK license via https://pspdfkit.com/support/request/\n\nAre you [evaluating our SDK](https://pspdfkit.com/try/)? That's great, we're happy to help out! To make sure this is fast, please use a work email and have someone from your company fill out our sales form: https://pspdfkit.com/sales/\n\n## Running Xamarin.Forms UWP Sample\n\n### Requirements\n\nIn order to build this project you need:\n\n- Windows 10\n- Visual Studio 2017 or 2019\n- PSPDFKit for Windows trial license. ([get your trial here](https://pspdfkit.com/try/))\n- [Visual Studio Tools for Xamarin](https://visualstudio.microsoft.com/xamarin/)\n- Getting familiar with [Xamarin.Forms UWP project setup](https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/windows/installation/).\n\n### Running the sample project\n\nOpen `XamarinPDF.sln` using Visual Studio and add your license key as a String value in the `App.xaml` file listed below:\n\n- [XamarinPDF/XamarinPDF.UWP/App.xaml](XamarinPDF/XamarinPDF.UWP/App.xaml)\n\nReplace `LICENSE_KEY_GOES_HERE` with your provided license from the PSPDFKit customer portal or trial key.\n\n```xaml\n\u003cResourceDictionary\u003e\n    \u003cx:String x:Key=\"PSPDFKitLicense\"\u003eLICENSE_KEY_GOES_HERE\u003c/x:String\u003e\n\u003c/ResourceDictionary\u003e\n```\n\nYou can now build and run the project.\n\n## Using PSPDFKit for Windows in your Xamarin.Forms UWP project\n\nFirst you need to follow the [PSPDFKit for Windows integration guide](https://pspdfkit.com/guides/windows/current/getting-started/integrating-pspdfkit/) then you can create a Xamarin.Forms control that inherits from [Xamarin.Forms.View](https://docs.microsoft.com/en-us/dotnet/api/xamarin.forms.view?view=xamarin-forms) which can be used to host the actual [PdfView](https://pspdfkit.com/api/windows/PSPDFKit/PSPDFKit.UI.PdfView.html) using a Xamarin.Forms custom renderer technique. We encourage you to read Xamarin.Forms [Implementing a View](https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/view) documentation, we use this pathern in the example project.\n\n### Xamarin.Forms Custom Control\n\n- [PdfViewer.cs](XamarinPDF/XamarinPDF/Views/PdfViewer.cs): This is the Xamarin.Forms custom control that is used to represent a [PdfView](https://pspdfkit.com/api/windows/PSPDFKit/PSPDFKit.UI.PdfView.html) in the Xamarin.Forms context. In this particular example it mirrors properties that are bindable from a XAML context.\n- [PdfViewerRenderer.cs](XamarinPDF/XamarinPDF.UWP/PageRenderers/PdfViewerRenderer.cs): This is the class that will actually contain the [PdfView](https://pspdfkit.com/api/windows/PSPDFKit/PSPDFKit.UI.PdfView.html) object initialization and implementation, `PdfViewerRenderer.cs` is hosted in the UWP project context, so it has access to all UWP platform features. [Creating the Custom Renderer on UWP](https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/view#creating-the-custom-renderer-on-uwp) document goes into greater detail on this subject.\n\nNow that you have both pieces in place, you can use [PdfViewer.cs](XamarinPDF/XamarinPDF/Views/PdfViewer.cs) from the Xamarin.Forms XAML context like this:\n\n```xaml\n\u003cContentPage.Content\u003e\n\t\u003cPdfViewer\n\t\tLicense=\"{StaticResource PSPDFKitLicense}\"\n\t\tPdfUriSource=\"ms-appx:///Assets/pdfs/default.pdf\"/\u003e\n\u003c/ContentPage.Content\u003e\n```\n\n**Note:**\n\n\u003e [PdfViewer.cs](XamarinPDF/XamarinPDF/Views/PdfViewer.cs) and [PdfViewerRenderer.cs](XamarinPDF/XamarinPDF.UWP/PageRenderers/PdfViewerRenderer.cs) are just provided as a way to achieve rendering a PDF within a Xamarin.Forms UWP application, you can definitely achieve the same result by creating a UWP page to host the [PdfView](https://pspdfkit.com/api/windows/PSPDFKit/PSPDFKit.UI.PdfView.html) and your own UWP logic and just use a `Xamarin.Forms.ContentPage` as a container of said UWP page. This is also demonstrated in this sample on [PrintPageContainer.cs](XamarinPDF/XamarinPDF/Views/PrintPageContainer.cs), [PrintPageRenderer.cs](XamarinPDF/XamarinPDF.UWP/PageRenderers/PrintPageRenderer.cs), [PrintPage.xaml.cs](XamarinPDF/XamarinPDF.UWP/Pages/PrintPage.xaml.cs) and [PrintPage.xaml](XamarinPDF/XamarinPDF.UWP/Pages/PrintPage.xaml).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpspdfkit%2Fxamarin-uwp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpspdfkit%2Fxamarin-uwp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpspdfkit%2Fxamarin-uwp/lists"}