Giter VIP home page Giter VIP logo

xamarin-uwp's Introduction

Xamarin.Forms UWP Sample

PSPDFKit

The PSPDFKit SDK is a framework that allows you to view, annotate, sign, and fill PDF forms on iOS, Android, Windows, macOS, and Web.

PSPDFKit Instant adds real-time collaboration features to seamlessly share, edit, and annotate PDF documents.

Related

Support, Issues and License Questions

PSPDFKit offers support for customers with an active SDK license via https://pspdfkit.com/support/request/

Are you evaluating our SDK? 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/

Running Xamarin.Forms UWP Sample

Requirements

In order to build this project you need:

Running the sample project

Open XamarinPDF.sln using Visual Studio and add your license key as a String value in the App.xaml file listed below:

Replace LICENSE_KEY_GOES_HERE with your provided license from the PSPDFKit customer portal or trial key.

<ResourceDictionary>
    <x:String x:Key="PSPDFKitLicense">LICENSE_KEY_GOES_HERE</x:String>
</ResourceDictionary>

You can now build and run the project.

Using PSPDFKit for Windows in your Xamarin.Forms UWP project

First you need to follow the PSPDFKit for Windows integration guide then you can create a Xamarin.Forms control that inherits from Xamarin.Forms.View which can be used to host the actual PdfView using a Xamarin.Forms custom renderer technique. We encourage you to read Xamarin.Forms Implementing a View documentation, we use this pathern in the example project.

Xamarin.Forms Custom Control

  • PdfViewer.cs: This is the Xamarin.Forms custom control that is used to represent a PdfView in the Xamarin.Forms context. In this particular example it mirrors properties that are bindable from a XAML context.
  • PdfViewerRenderer.cs: This is the class that will actually contain the PdfView 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 document goes into greater detail on this subject.

Now that you have both pieces in place, you can use PdfViewer.cs from the Xamarin.Forms XAML context like this:

<ContentPage.Content>
	<PdfViewer
		License="{StaticResource PSPDFKitLicense}"
		PdfUriSource="ms-appx:///Assets/pdfs/default.pdf"/>
</ContentPage.Content>

Note:

PdfViewer.cs and 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 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, PrintPageRenderer.cs, PrintPage.xaml.cs and PrintPage.xaml.

xamarin-uwp's People

Contributors

dalexsoto avatar gabrielbunselmeyer avatar patrik64 avatar phraemer avatar steipete avatar take-a-byte avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.