Some test text!

menu
search

Customize PDFViewCtrl

PDFTron SDK uses a viewing UI component developed in-house that you can customize.

Customization PTPDFViewCtrl

This tutorial only applies to Xamarin.iOS. See Xamarin.Android equivalent here.

The PDFViewCtrl has a large API that can be used to control how the PDF is presented to the user. All of the APIs that you can use are well documented. This guide highlights some of the most commonly used functionality.

If you are using a PTDocumentViewController (or PTTabbedDocumentViewController), the contained PTPDFViewCtrl can be accessed as a property:

var documentViewController = new pdftron.PDF.Controls.PTDocumentViewController();

documentViewController.pdfViewCtrl

linkProperties and methods

APIDescription
SetPagePresentationModeSet how pages are presented and scrolled: in 1 or 2 columns, scrolled vertically or horizontally
SetPageViewModeSets the zoom level relative to the page size, fit-width, fit-height or fit-page.
SetPageRefViewModeWhen a document is scrolled via horizontal swipes, use this method to control what zoom level new pages are rendered at.
SetBackgroundColorSets the color that is seen around pages.
SetupThumbnailsControls how low-resolution thumbnails are handled. Enlarged thumbnails are used in place of high-resolution content while the high-resolution content is being rendered.
overlayViewThis view is used for drawing system-content over the PDF.
SetProgressiveRenderingControls how frequently the high-resolution content is updated while it is being rendered.
SetDrawAnnotationsControls if annotations are visible.
SetHighlightFieldsControls if form fields are shaded with light blue.
SetOverprintControls how PDFs that use overprint colors are rendered.
SetColorPostProcessModeCan be used to turn on night-mode and other color processing changes.

linkDelegate callbacks

The PDFViewCtrl includes two delegates (delegate and toolDelegate) to relay touch and other events that occur on the control.

The first is a general purpose delegate, the second was designed specifically for enabling the Tools.framework functionality via its conforming object PTToolManager. If you are using the tools framework, a PTToolManager should always be assigned as the PTPDFViewCtrl's toolDelegate object. If you are not using the Tools.framework, it may be used for whatever purpose your app requires.

Delegates when using a PTDocumentViewController
When using a PTDocumentViewController (or PTTabbedDocumentViewController), the PTPDFViewCtrl delegates are used internally and cannot be reassigned to another object. To receive the delegate callbacks, create a subclass of PTDocumentViewController and implement the required methods, being sure to call super.

Get the answers you need: Support

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.

PDFTron Receives USD$71 Million Growth Investment Led By Silversmith Capital Partners

Learn More
close