ComPDF React Native - v3.0.0
    Preparing search index...

    Interface CPDFContextMenuConfig

    Context menu configuration interface. Used to customize long-press menu options in different modes. For example, selecting a highlight annotation in annotation mode, or long-pressing a blank area in text editing mode.

    interface CPDFContextMenuConfig {
        backgroundColor?: `#${string}`;
        fontSize?: number;
        padding?: Padding;
        iconSize?: number;
        global?: { screenshot?: CPDFContextMenuItem<GlobalMenuKey>[] };
        viewMode?: { textSelect?: CPDFContextMenuItem<ViewTextSelectKey>[] };
        annotationMode?: {
            textSelect?: CPDFContextMenuItem<AnnotationTextSelectKey>[];
            longPressContent?: CPDFContextMenuItem<LongPressContentKey>[];
            markupContent?: CPDFContextMenuItem<MarkupContentKey>[];
            soundContent?: CPDFContextMenuItem<SoundContentKey>[];
            inkContent?: CPDFContextMenuItem<InkContentKey>[];
            shapeContent?: CPDFContextMenuItem<ShapeContentKey>[];
            freeTextContent?: CPDFContextMenuItem<FreeTextContentKey>[];
            signStampContent?: CPDFContextMenuItem<SignStampContentKey>[];
            stampContent?: CPDFContextMenuItem<StampContentKey>[];
            linkContent?: CPDFContextMenuItem<LinkContentKey>[];
        };
        contentEditorMode?: {
            editTextAreaContent?: CPDFContextMenuItem<EditTextAreaContentKey>[];
            editSelectTextContent?: CPDFContextMenuItem<EditSelectTextContentKey>[];
            editTextContent?: CPDFContextMenuItem<EditTextContentKey>[];
            imageAreaContent?: CPDFContextMenuItem<ImageAreaContentKey>[];
            imageCropMode?: CPDFContextMenuItem<ImageCropModeKey>[];
            editPathContent?: CPDFContextMenuItem<"delete">[];
            longPressWithEditTextMode?: CPDFContextMenuItem<
                LongPressWithEditTextModeKey,
            >[];
            longPressWithEditImageMode?: CPDFContextMenuItem<
                LongPressWithEditImageModeKey,
            >[];
            longPressWithAllMode?: CPDFContextMenuItem<LongPressWithAllModeKey>[];
            searchReplace?: CPDFContextMenuItem<"replace">[];
        };
        formMode?: {
            textField?: CPDFContextMenuItem<FormPropertiesDeleteKey>[];
            checkBox?: CPDFContextMenuItem<FormPropertiesDeleteKey>[];
            radioButton?: CPDFContextMenuItem<FormPropertiesDeleteKey>[];
            listBox?: CPDFContextMenuItem<FormOptionsPropertiesDeleteKey>[];
            comboBox?: CPDFContextMenuItem<FormOptionsPropertiesDeleteKey>[];
            pushButton?: CPDFContextMenuItem<FormOptionsPropertiesDeleteKey>[];
            signatureField?: CPDFContextMenuItem<SignatureFieldKey>[];
        };
    }
    Index

    Properties

    backgroundColor?: `#${string}`

    Background color of the context menu. Only support HEX color format, e.g. #1460F3 Only supported on Android platform.

    fontSize?: number

    Font size of the context menu text. defalut value: 14 dp

    padding?: Padding

    Padding of the context menu. Order: [left, top, right, bottom] Only supported on Android platform.

    iconSize?: number

    Icon size of the context menu. defalut value: 36 dp

    global?: { screenshot?: CPDFContextMenuItem<GlobalMenuKey>[] }

    Type Declaration

    viewMode?: { textSelect?: CPDFContextMenuItem<ViewTextSelectKey>[] }

    Type Declaration

    annotationMode?: {
        textSelect?: CPDFContextMenuItem<AnnotationTextSelectKey>[];
        longPressContent?: CPDFContextMenuItem<LongPressContentKey>[];
        markupContent?: CPDFContextMenuItem<MarkupContentKey>[];
        soundContent?: CPDFContextMenuItem<SoundContentKey>[];
        inkContent?: CPDFContextMenuItem<InkContentKey>[];
        shapeContent?: CPDFContextMenuItem<ShapeContentKey>[];
        freeTextContent?: CPDFContextMenuItem<FreeTextContentKey>[];
        signStampContent?: CPDFContextMenuItem<SignStampContentKey>[];
        stampContent?: CPDFContextMenuItem<StampContentKey>[];
        linkContent?: CPDFContextMenuItem<LinkContentKey>[];
    }

    Context menu configuration in annotation mode.

    Type Declaration

    • OptionaltextSelect?: CPDFContextMenuItem<AnnotationTextSelectKey>[]

      Menu options shown when long-pressing selected text in annotation mode.

      textSelect: menus('copy', 'highlight', 'underline', 'strikeout', 'squiggly')
      
    • OptionallongPressContent?: CPDFContextMenuItem<LongPressContentKey>[]

      Menu options shown when long-pressing a blank area in the PDF document.

      longPressContent: menus('paste', 'note', 'textBox', 'stamp', 'image')
      
    • OptionalmarkupContent?: CPDFContextMenuItem<MarkupContentKey>[]

      Menu options shown when selecting markup annotations in annotation mode.

      markupContent: menus('properties', 'note', 'reply', 'viewReply', 'delete')
      
    • OptionalsoundContent?: CPDFContextMenuItem<SoundContentKey>[]

      Menu options shown for sound annotations in annotation mode.

      soundContent: menus('reply', 'viewReply', 'play', 'record', 'delete')
      
    • OptionalinkContent?: CPDFContextMenuItem<InkContentKey>[]

      Menu options shown for ink annotations in annotation mode.

      inkContent: menus('properties', 'note', 'reply', 'viewReply', 'delete')
      
    • OptionalshapeContent?: CPDFContextMenuItem<ShapeContentKey>[]

      Menu options shown for shape annotations in annotation mode. Includes: rectangle, circle, line, and arrow annotations.

      shapeContent: menus('properties', 'note', 'reply', 'viewReply', 'delete')
      
    • OptionalfreeTextContent?: CPDFContextMenuItem<FreeTextContentKey>[]

      Menu options shown for free text annotations in annotation mode.

      freeTextContent: menus('properties', 'edit', 'reply', 'viewReply', 'delete')
      
    • OptionalsignStampContent?: CPDFContextMenuItem<SignStampContentKey>[]

      Menu options shown for signature stamp annotations in annotation mode. Includes: sign, delete, and rotate.

      signStampContent: menus('signHere', 'delete', 'rotate')
      
    • OptionalstampContent?: CPDFContextMenuItem<StampContentKey>[]

      Menu options shown for stamp annotations in annotation mode.

      stampContent: menus('note', 'reply', 'viewReply', 'delete', 'rotate')
      
    • OptionallinkContent?: CPDFContextMenuItem<LinkContentKey>[]

      Menu options shown for link annotations in annotation mode.

      linkContent: menus('edit', 'delete')
      
    contentEditorMode?: {
        editTextAreaContent?: CPDFContextMenuItem<EditTextAreaContentKey>[];
        editSelectTextContent?: CPDFContextMenuItem<EditSelectTextContentKey>[];
        editTextContent?: CPDFContextMenuItem<EditTextContentKey>[];
        imageAreaContent?: CPDFContextMenuItem<ImageAreaContentKey>[];
        imageCropMode?: CPDFContextMenuItem<ImageCropModeKey>[];
        editPathContent?: CPDFContextMenuItem<"delete">[];
        longPressWithEditTextMode?: CPDFContextMenuItem<
            LongPressWithEditTextModeKey,
        >[];
        longPressWithEditImageMode?: CPDFContextMenuItem<
            LongPressWithEditImageModeKey,
        >[];
        longPressWithAllMode?: CPDFContextMenuItem<LongPressWithAllModeKey>[];
        searchReplace?: CPDFContextMenuItem<"replace">[];
    }

    Context menu configuration in content editor mode.

    Type Declaration

    • OptionaleditTextAreaContent?: CPDFContextMenuItem<EditTextAreaContentKey>[]

      this is the menu options shown when clicking on a text area in content editor mode.

      editTextAreaContent: menus('properties', 'edit', 'cut', 'copy', 'delete')
      
    • OptionaleditSelectTextContent?: CPDFContextMenuItem<EditSelectTextContentKey>[]

      This is the menu options shown when the text area enters edit mode and text is selected.

      editSelectTextContent: menus(
      'properties',
      { key: 'opacity', subItems:['25%', '50%', '75%', '100%'] },
      'cut',
      'copy',
      'delete'
      )
    • OptionaleditTextContent?: CPDFContextMenuItem<EditTextContentKey>[]

      This is the menu options shown when clicking anywhere in the text area edit state.

      editTextAreaClickContent: menus('select', 'selectAll', 'paste')
      
    • OptionalimageAreaContent?: CPDFContextMenuItem<ImageAreaContentKey>[]

      This is the menu options shown when clicking on an image in content editor mode.

      imageAreaContent: menus(
      'properties',
      'rotateLeft',
      'rotateRight',
      'replace',
      'export',
      { key: 'opacity', subItems:['25%', '50%', '75%', '100%'] },
      'flipHorizontal',
      'flipVertical',
      'crop',
      'delete',
      'copy',
      'cut'
    • OptionalimageCropMode?: CPDFContextMenuItem<ImageCropModeKey>[]

      this is the menu options shown when the image enters crop mode.

      imageCropMode: menus('done', 'cancel')
      
    • OptionaleditPathContent?: CPDFContextMenuItem<"delete">[]

      This is the menu options shown when clicking on a path in content editor mode.

    • OptionallongPressWithEditTextMode?: CPDFContextMenuItem<LongPressWithEditTextModeKey>[]

      Content Editing Mode: Menu options when you long press on a blank area of ​​a PDF in text editing mode.

      longPressWithEditTextMode: menus('addText', 'paste', 'keepSourceFormatingPaste')
      
    • OptionallongPressWithEditImageMode?: CPDFContextMenuItem<LongPressWithEditImageModeKey>[]

      Content Editing Mode: Menu options when you long press on the blank area of ​​the PDF in the Edit Image mode.

      longPressWithEditImageMode: menus('addImage', 'paste')
      
    • OptionallongPressWithAllMode?: CPDFContextMenuItem<LongPressWithAllModeKey>[]

      In content editing mode, long press the blank area of ​​the PDF to select the menu option.

      longPressWithAllMode: menus('paste', 'keepSourceFormatingPaste')
      
    • OptionalsearchReplace?: CPDFContextMenuItem<"replace">[]

      In content editing mode, when performing text search and replacement, a menu option pops up after selecting the searched text.

      searchReplace: menus('replace')
      

    Type Declaration