App event callback functions

Used to handle various application events, such as language interface changes and tool switches.

{
onAppConvertPDF: (clientData, inPath, outPath) => {
console.log('PDF file conversion successful:', inPath, outPath);
}
}
interface AppEventCallbacksType {
    onAppActivate?: (clientData: LPVOIDType, active: boolean) => void;
    onAppChangedTaskPane?: (clientData: LPVOIDType, name: string) => void;
    onAppMainFrameClientSize?: (clientData: LPVOIDType) => void;
    onAppMainFrameSize?: (clientData: LPVOIDType) => void;
    onAppMainFrmLoadFinish?: (clientData: LPVOIDType) => void;
    onAppOpenDocument?: (clientData: LPVOIDType, filePath: string) => boolean;
    onAppPluginLoaded?: (clientData: LPVOIDType, pluginName: string) => void;
    onAppPluginUnLoaded?: (clientData: LPVOIDType, pluginName: string) => void;
    onAppQuit?: (clientData: LPVOIDType) => void;
    onAppRibbonCategoryBeforeChange?: (
        clientData: LPVOIDType,
        categoryName: string,
    ) => void;
    onAppRibbonCategoryChanged?: (
        clientData: LPVOIDType,
        categoryName: string,
    ) => void;
    onAppShowRibbonFilePage?: (clientData: LPVOIDType) => void;
    onAppShowRibbonFilePageFinish?: (clientData: LPVOIDType) => void;
    onAppShowTaskPane?: (clientData: LPVOIDType, isShow: boolean) => void;
}

Properties

onAppActivate?: (clientData: LPVOIDType, active: boolean) => void

It is called whenever the application is to being activated or deactivated.

Type declaration

    • (clientData: LPVOIDType, active: boolean): void
    • Parameters

      • clientData: LPVOIDType

        The user-supplied data

      • active: boolean

      Returns void

onAppChangedTaskPane?: (clientData: LPVOIDType, name: string) => void

It is called by Foxit Reader when the task panel was changed.

Type declaration

    • (clientData: LPVOIDType, name: string): void
    • Parameters

      • clientData: LPVOIDType

        The user-supplied data

      • name: string

        Changed the name of the task panel.

      Returns void

onAppMainFrameClientSize?: (clientData: LPVOIDType) => void

It is called by Foxit Reader when the main frame client size is changing.

Type declaration

onAppMainFrameSize?: (clientData: LPVOIDType) => void

It is called by Foxit Reader when the main frame’s size is changing.

Type declaration

onAppMainFrmLoadFinish?: (clientData: LPVOIDType) => void

It is called by Foxit Reader when the main frame finishes loading.

Type declaration

onAppOpenDocument?: (clientData: LPVOIDType, filePath: string) => boolean

It is called by Foxit Reader when Foxit Reader is going to open a document. Returning TRUE means the plug-in will take over the process, and the Foxit Reader will terminate the process, otherwise the Foxit Reader will continue the opening process.

Type declaration

    • (clientData: LPVOIDType, filePath: string): boolean
    • Parameters

      • clientData: LPVOIDType

        The user-supplied data

      • filePath: string

        The file path to be opened.

      Returns boolean

      TRUE means the plug-in will take over the process, and the Foxit Reader will terminate the process, otherwise the Foxit Reader will continue the opening process.

onAppPluginLoaded?: (clientData: LPVOIDType, pluginName: string) => void

It is called by Foxit Reader when the plugin is loaded.

Type declaration

    • (clientData: LPVOIDType, pluginName: string): void
    • Parameters

      • clientData: LPVOIDType

        The user-supplied data

      • pluginName: string

        the plugin name.

      Returns void

onAppPluginUnLoaded?: (clientData: LPVOIDType, pluginName: string) => void

It is called by Foxit Reader when the plugin is loaded.

Type declaration

    • (clientData: LPVOIDType, pluginName: string): void
    • Parameters

      • clientData: LPVOIDType

        The user-supplied data

      • pluginName: string

        the plugin name.

      Returns void

onAppQuit?: (clientData: LPVOIDType) => void

It is called at the shutdown time.

Type declaration

onAppRibbonCategoryBeforeChange?: (
    clientData: LPVOIDType,
    categoryName: string,
) => void

It is called by Foxit Reader when the ribbon category before change.

Type declaration

    • (clientData: LPVOIDType, categoryName: string): void
    • Parameters

      • clientData: LPVOIDType

        The user-supplied data

      • categoryName: string

        he actived ribbon category name.

      Returns void

onAppRibbonCategoryChanged?: (
    clientData: LPVOIDType,
    categoryName: string,
) => void

It is called by Foxit Reader when the ribbon category is changed.

Type declaration

    • (clientData: LPVOIDType, categoryName: string): void
    • Parameters

      • clientData: LPVOIDType

        The user-supplied data

      • categoryName: string

        The actived ribbon category name.

      Returns void

onAppShowRibbonFilePage?: (clientData: LPVOIDType) => void

It is called by Foxit Reader when the ribbon file page shows.

Type declaration

onAppShowRibbonFilePageFinish?: (clientData: LPVOIDType) => void

It is called by Foxit Reader when the ribbon file page shows finish.

Type declaration

onAppShowTaskPane?: (clientData: LPVOIDType, isShow: boolean) => void

It is called by Foxit Reader when the task pane is being shown.

Type declaration

    • (clientData: LPVOIDType, isShow: boolean): void
    • Parameters

      • clientData: LPVOIDType

        The user-supplied data

      • isShow: boolean

        Whether the task pane is to be shown or not.

      Returns void