Remove Font Selector

Product: PDFTron

Product Version: Latest

Please give a brief summary of your issue:
We only want to support one font (Arial) on iOS. The default is current is Helvetica. How would I set the default and remove the ability to select a different font? Users call select the font from a free text or a call out annotation.

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi Jack,

You can achieve this by subclassing the PTAnnotStyle class and overriding the availableStyleKeys property. Then removing the “AnnotStyleKeyFont” key from the list of keys.

To override a class have a look at this guide: PDFTron Systems Inc. | Documentation

The code would look something like this:

class CustomPTAnnotStyle: PTAnnotStyle {
    override var availableStyleKeys: [PTAnnotStyleKey] {
        get {
            return super.availableStyleKeys.filter { key in
                key != PTAnnotStyleKey.font
            }
        }
    }
}

Please let us know if this works for you.

Best Regards,
Sahil Behl.

Product: pdftron-react-native

Product Version: Latest

Hello Sahil,

We’re having the exact same problem on pdftron-react-native. We would like to only allow selection of one font-family (PlusJakarta) on iOS. The default is also set to Helvetica. How can i change the default font and remove the selector. I can’t seem to find anything on the docs regarding that on the react-native library.

Best regards,
Arthur Paes