Some test text!

Search
Hamburger Icon

Xamarin / Guides

Custom Tool

Apryse SDK gives you the ability to create your own tools should you need one.

Creating a custom annotation tool in Xamarin.iOS

It is possible to create a new tool via C# API if you are looking for very simple tools that do not require much UI. Otherwise, you will have to customize the tools source code in Objective-C . The following section describes how to create a simple tool via C# API.

  1. Creating CustomTool:

    using System;
    using ObjCRuntime;
    using pdftron.PDF;
    
    namespace PDFNetiOSXamarinSample
    {
        public class CustomTool : pdftron.PDF.Tools.PTCreateToolBase
        {
            public CustomTool(PDFViewCtrl ctrl) : base(ctrl)
            {
            }
    
            public override bool CreatesAnnotation
            {
                get
                {
                    return true;
                }
            }
    
            public override Class AnnotClass
            {
                get
                {
                    return new Class(typeof(pdftronprivate.PTRedactionAnnot));
                }
            }
        }
    
    }
  2. Using the tool:

mToolManager.Tool = new CustomTool(mPdfViewCtrl);

To learn more about how to modify the tools source code in Objective-C, check out this guide: Creating a new tool .

Trial setup questions? Ask experts on Discord
Need other help? Contact Support
Pricing or product questions? Contact Sales