文档事件回调函数

用于文档级事件处理程序的回调集合。

{
onOpen: (clientData, doc) => {
console.log('When the document is about to open:', clientData, doc);
}
}
interface DocEventCallbacksType {
    onActivate?: (clientData: LPVOIDType, doc: DocType) => void;
    onAnnotKillFocus?: (
        clientData: LPVOIDType,
        doc: DocType,
        focusAnnot: AnnotType,
    ) => void;
    onAnnotSelectionChanged?: (clientData: LPVOIDType) => void;
    onAnnotSetFocus?: (
        clientData: LPVOIDType,
        doc: DocType,
        focusAnnot: AnnotType,
    ) => void;
    onClose?: (clientData: LPVOIDType) => void;
    onDeactivate?: (clientData: LPVOIDType, doc: DocType) => void;
    onFileClose?: (clientData: LPVOIDType, filePath: string) => void;
    onFinishRender?: (clientData: LPVOIDType, docView: DocViewType) => void;
    onOpen?: (clientData: LPVOIDType, doc: DocType) => void;
    onOtherDocActivate?: (clientData: LPVOIDType) => void;
    onOtherDocDeactivate?: (clientData: LPVOIDType) => void;
    onPermissionChange?: (clientData: LPVOIDType, doc: DocType) => void;
    onPrint?: (clientData: LPVOIDType, doc: DocType) => void;
    onSave?: (clientData: LPVOIDType, doc: DocType, isSaveAs: boolean) => void;
}

Properties

onActivate?: (clientData: LPVOIDType, doc: DocType) => void

每当文档将被激活时调用。

Type declaration

onAnnotKillFocus?: (
    clientData: LPVOIDType,
    doc: DocType,
    focusAnnot: AnnotType,
) => void

当批注失去焦点时调用。

Type declaration

onAnnotSelectionChanged?: (clientData: LPVOIDType) => void

每当注解选择发生变化时调用。

Type declaration

onAnnotSetFocus?: (
    clientData: LPVOIDType,
    doc: DocType,
    focusAnnot: AnnotType,
) => void

当表单字段发生变化时调用。

Type declaration

onClose?: (clientData: LPVOIDType) => void

当文档被完全关闭时调用。

Type declaration

onDeactivate?: (clientData: LPVOIDType, doc: DocType) => void

每当文档将被停用时调用。

Type declaration

onFileClose?: (clientData: LPVOIDType, filePath: string) => void

当一个文件被完全释放时调用。

Type declaration

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

      • clientData: LPVOIDType

        用户提供的数据

      • filePath: string

        已关闭的文件路径。

      Returns void

onFinishRender?: (clientData: LPVOIDType, docView: DocViewType) => void

当文档视图开始自动滚动时调用。

Type declaration

onOpen?: (clientData: LPVOIDType, doc: DocType) => void

在文档打开时调用。

Type declaration

onOtherDocActivate?: (clientData: LPVOIDType) => void

当需要停用非 PDF 文档时调用。

Type declaration

onOtherDocDeactivate?: (clientData: LPVOIDType) => void

当需要停用非 PDF 文档时调用。

Type declaration

onPermissionChange?: (clientData: LPVOIDType, doc: DocType) => void

当文档的权限被更改后调用。

Type declaration

onPrint?: (clientData: LPVOIDType, doc: DocType) => void

当打印机完成工作时调用。

Type declaration

onSave?: (clientData: LPVOIDType, doc: DocType, isSaveAs: boolean) => void

当文档完全保存时调用。

Type declaration

    • (clientData: LPVOIDType, doc: DocType, isSaveAs: boolean): void
    • Parameters

      • clientData: LPVOIDType

        用户提供的数据

      • doc: DocType

        成为活动文档的 Document。

      • isSaveAs: boolean

        一个标志,指示用户是点击“保存”按钮还是点击“另存为”按钮。

      Returns void