Getting started with XFINIUM.PDF Viewer in iOS applications

This tutorial will show how to get started with XFINIUM.PDF Viewer in Xamarin.iOS applications.

1. Create a new iOS application using Visual Studio for Mac.

Getting started with XFINIUM.PDF viewer in iOS applications

2. Add references to xfinium.pdf.xamarin.ios.dll, xfinium.pdf.render.xamarin.ios.dll, xfinium.pdf.view.xamarin.ios.dll, in your project.

3. Open the application storyboard with Visual Studio iOS designer.

4. Locate the PdfCoreView control in the Toolbox (in the Custom Controls section), add it to the storyboard and set its name to ‘documentView‘.

5. Add a test PDF file to application and set its BuildAction to Content.

6. In view controller’s ViewDidLoad method create a PdfVisualDocument object, set the documentView.Document property with the PdfVisualDocument object and load a file in the document.

documentView.Document = new Xfinium.Pdf.View.PdfVisualDocument();
documentView.GraphicRendererFactory = new Xfinium.Graphics.CoreGraphics.CoreGraphicsRendererFactory();
FileStream pdfStream = File.OpenRead(NSBundle.MainBundle.BundlePath + "/xfinium.pdf");

7. Run the application.

Getting started with XFINIUM.PDF viewer in iOS applications

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: