Some test text!

How do I customize the sticky note icon picker?

In this document
chevron_rightAdd customized sticky note icons
This guide requires an SVG to PDF conversion tool to create the PDF file containing your custom sticky note icons.

linkAdd customized sticky note icons

In this guide, we'll add a new Right Arrow icon to the sticky note icon picker. The source code for this sample can be found at our PDFTron Android Samples GitHub repository.

  1. First create a PDF file called stickynote_icons.pdf containing your icons. Each page of the PDF will contain a vector icon and a page label that we'll use as a reference later.

    Using the existing default stickynote_icons.pdf (which can be found here), we'll add a new page containing our custom vector icon and give it a page label called RightArrow. For reference, the resulting stickynote_icons.pdf file can be found here.

    Afterwards, add this to the /res/raw folder in your Android project.

You can modify the page labels in a PDF file using the PDFTron SDK. A sample can be found here.
  1. Now create two Android drawables of our custom icon, one for the fill color and the other one for the border. These will be used for the UI buttons in the icon picker. The drawables will be named as follows:

    • Create an icon drawable with a white fill color. Name the drawable file with your custom icon's page label prefixed with annotation_note_icon_ and suffixed with _fill.

      For example. annotation_note_icon_RightArrow_fill.xml.

    • Create another icon drawable with outline only. Name the drawable file with your custom icon's page label prefixed with annotation_note_icon_ and suffixed with _outline.

      For example annotation_note_icon_RightArrow_outline.xml.

    Add these two to the /res/drawable folder in your Android project

  2. Finally add a string array to /res/arrays.xml called custom_icons that references the page labels in stickynote_icons.pdf. This list defines the available icons in the sticky note icon picker.

    <string-array name="custom_icons">
        <!-- Add some default icons -->
        <item>Comment</item>
        <item>Help</item>
        <item>InsertCaret</item>
        <item>Star</item>
        <item>LightBulb</item>
        <item>NewParagraph</item>
        <item>CrossMark</item>
        <item>CheckMark</item>
        <item>LocationPin</item>
        <item>ThumbsUp</item>
        <!-- Add our custom icon -->
        <item>RightArrow</item>
    </string-array>

    You can reorder, add, or remove items from this string array to further customize your sticky note icon picker.