Some test text!

keyboard_arrow_down

Get started

Download PDFTron SDK
play_arrow

Quick start - view a document

Xamarin.AndroidXamarin.iOSIntegrate with NuGetIntegrate manuallyAdd license keyPermissions (Android)Run samplesUpdate to latest version
keyboard_arrow_down

Xamarin.Forms

Document viewerBasic viewer
keyboard_arrow_down

Fundamentals

Java binding (Android)Objective-C binding (iOS)Code sharingDocument lockingDocument saving
keyboard_arrow_down

Document Viewer

play_arrow

Xamarin.Android

play_arrow

Xamarin.iOS

Show a document in a ViewControllerShow documents in a tabbed ViewControllerOpen from online URL
keyboard_arrow_down

Document Viewer components

Overview
play_arrow

PDFViewCtrl

Xamarin.AndroidXamarin.iOS
play_arrow

Reflow

Quick menuCustomize quick menu
play_arrow

Annotation toolbar

play_arrow

Annotation style editor

Xamarin.AndroidXamarin.iOS
play_arrow

Page slider

play_arrow

List container

play_arrow

Annotation list

play_arrow

Document outline

play_arrow

User bookmark list

play_arrow

Thumbnail browser

Add pages dialogCrop pages dialogRotate pages dialogView mode dialog
keyboard_arrow_down

Annotation and collaboration

OverviewToolManager setupRead only mode
play_arrow

Disable annotation creation and editing

play_arrow

Default annotation properties

play_arrow

Change tool mode

Xamarin.AndroidXamarin.iOS
play_arrow

Events

Xamarin.AndroidXamarin.iOS
play_arrow

Override annotation handling

Show and hide existing annotationsRealtime collaboration
keyboard_arrow_down

Advanced customization

play_arrow

Add a custom view to a page

Xamarin.AndroidXamarin.iOSCreate a custom toolPage color modePage fit modePage layout modeScrolling direction
keyboard_arrow_down

Conversion

keyboard_arrow_down

Parsing and extraction

keyboard_arrow_down

Digital signatures

keyboard_arrow_down

Form filling

keyboard_arrow_down

Search

play_arrow

Text search

Xamarin.AndroidXamarin.iOS
keyboard_arrow_down

Redaction

keyboard_arrow_down

Advanced topics

PrintUnderstand coordinatesGenerate page thumbnails
keyboard_arrow_down

Reference

LocalizationIcon cheat sheet
keyboard_arrow_down

PDF Processing API

What is PDFNet?Opening a documentSerializing (saving) a documentWorking with pagesWorking with Page ContentWorking with BookmarksWorking with Interactive Forms (AcroForms)PDF SecurityLow-level PDF APIError handling
Xamarin.Androidkeyboard_arrow_down

Text search

In this document
chevron_rightPrerequisites
chevron_rightAdd text search using UI component
chevron_rightSearch results view
This tutorial only applies to Xamarin.Android.

Text search functionality can be added to your viewer using the text search UI component. Alternatively, you can programmatically perform text search in PDFViewCtrl.

linkPrerequisites

linkAdd text search using UI component

PDFTron provides SearchToolbar and FindTextOverlay as utility classes for implementing text search in your document viewer. Here is a short guide on adding text search to your activity:

  1. Add the search controls to your layout, a simple example will be something like:

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                    xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
      <LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical">
        <pdftron.PDF.Controls.SearchToolbar
            android:id="@+id/searchtoolbar"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minHeight="?attr/actionBarSize"
            app:contentInsetStart="@dimen/second_keyline"
            android:background="?attr/colorPrimary"
            app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
            app:navigationIcon="@drawable/ic_arrow_back_white_24dp" />
        <pdftron.PDF.PDFViewCtrl
            android:id="@+id/pdfviewctrl"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:scrollbars="vertical|horizontal" />
      </LinearLayout>
      <pdftron.PDF.Controls.FindTextOverlay
            android:id="@+id/find_text_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone"/>
    </RelativeLayout>
  2. In onCreate of your activity, set up your SearchToolbar and FindTextOverlay:

  3. Show the layout

Now when running the app, you will see a toolbar that allows you to enter search terms as well as an overlay on top of the PDFViewCtrl that navigates among search results.

linkSearch results view

SearchResultsView class enables users to easily search for a query and see the results.

To set up your layout for a SearchResultsView, add an element to your XML layout as follows:

<com.pdftron.pdf.controls.SearchResultsView
    android:id="@+id/searchResultsView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

Then, you need to set SearchResultsListener to receive a callback when

  • An item from the search results is clicked
  • A full-text search is started and result has not yet been ready
  • A search is found