Configuring DocumentActivity and PdfViewCtrlTabHostFragment

This article only applies to Xamarin.Android.

Using PdfFragmentConfig in Xamarin.Android is identical to using PdfFragmentConfig in Android. See tutorial here.

For example, the equivalent of the example provided in the Android guide will be:

var builder = new PdfFragmentConfig.Builder();
var config = builder
    .FullscreenModeEnabled(true)
    .MultiTabEnabled(true)
    .DocumentEditingEnabled(true)
    .LongPressQuickMenuEnabled(true)
    .ShowPageNumberIndicator(true)
    .ShowBottomNavBar(true)
    .ShowThumbnailView(true)
    .ShowBookmarksView(true)
    .ToolbarTitle("PDFTron")
    .ShowSearchView(true)
    .ShowShareOption(true)
    .ShowDocumentSettingsOption(true)
    .ShowAnnotationToolbarOption(true)
    .ShowOpenFileOption(true)
    .ShowOpenUrlOption(true)
    .ShowEditPagesOption(true)
    .ShowPrintOption(true)
    .ShowCloseTabOption(true)
    .ShowAnnotationsList(true)
    .ShowOutlineList(true)
    .ShowUserBookmarksList(true)
    .Build();

For PDFViewCtrl:

var pdfViewCtrlConfig = PDFViewCtrlConfig.GetDefaultConfig(this)
    .SetClientBackgroundColor(Android.Graphics.Color.Yellow)
    .SetClientBackgroundColorDark(Android.Graphics.Color.Blue)
    .SetHighlightFields(true)
    .SetImageSmoothing(true)
    .SetUrlExtraction(true)
    .SetMaintainZoomEnabled(true);

var builder = new PdfFragmentConfig.Builder();
var config = builder
    ...
    .PdfViewCtrlConfig(pdfViewCtrlConfig)
    .Build();

For ToolManager:

var toolManagerBuilder = ToolManagerBuilder.From(this, Resource.Style.MyToolManager);
var builder = new PdfFragmentConfig.Builder();
var config = builder
    ...
    .SetToolManagerBuilder(toolManagerBuilder)
    .Build();