interface PDFDictionaryType {
    addReference: (
        key: string,
        doc: DocType,
        objNum: number,
    ) => Promise<void>;
    addValue: (key: string, obj: AddValueObjType) => Promise<void>;
    destroy: () => Promise<void>;
    getArray: (key: string) => Promise<null | PDFArrayType>;
    getBoolean: (key: string, defaultBool?: boolean) => Promise<boolean>;
    getCount: () => Promise<number>;
    getDict: (key: string) => Promise<null | PDFDictionaryType>;
    getElement: (key: string) => Promise<null | PDFObjectType>;
    getElementValue: (key: string) => Promise<null | PDFObjectType>;
    getFloat: (key: string) => Promise<number>;
    getInteger: (key: string, defaultInt: number) => Promise<number>;
    getInteger64: (key: string) => Promise<number>;
    getMatrix: (key: string) => Promise<Matrix>;
    getName: (key: string) => Promise<null | PDFObjectType>;
    getNumber: (key: string) => Promise<number>;
    getRect: (key: string) => Promise<Rect>;
    getString: (key: string) => Promise<string>;
    getUnicodeText: (key: string) => Promise<string>;
    isIdentical: (otherDict: PDFDictionaryType) => Promise<boolean>;
    keyExist: (key: string) => Promise<boolean>;
    options: Options;
    removeAt: (key: string) => Promise<void>;
    replaceKey: (oldKey: string, newKey: string) => Promise<void>;
    setAt: (key: string, obj: PDFObjectType, doc: DocType) => Promise<void>;
    setAtBoolean: (key: string, bool: boolean) => Promise<void>;
    setAtInteger: (key: string, num: number) => Promise<void>;
    setAtMatrix: (key: string, matrix: Matrix) => Promise<void>;
    setAtName: (key: string, name: string) => Promise<void>;
    setAtNumber: (key: string, num: number) => Promise<void>;
    setAtRect: (key: string, rect: Rect) => Promise<void>;
    setAtReference2ToDoc: (
        key: string,
        doc: DocType,
        obj: PDFObjectType,
    ) => Promise<void>;
    setAtReferenceToDoc: (
        key: string,
        doc: DocType,
        objNum: number,
    ) => Promise<void>;
    setAtString: (key: string, str: string) => Promise<void>;
    setNewAt: (
        key: string,
        objectType: number,
    ) => Promise<null | PDFObjectType>;
    getStartPosition(): Promise<null | POSITION>;
}

Implemented by

Properties

addReference: (key: string, doc: DocType, objNum: number) => Promise<void>

Add a reference object for the element specified by key.

Type declaration

    • (key: string, doc: DocType, objNum: number): Promise<void>
    • Parameters

      • key: string

        The input key string.

      • doc: DocType

        The input document object.

      • objNum: number

        The referred object number for the reference object.

      Returns Promise<void>

addValue: (key: string, obj: AddValueObjType) => Promise<void>

Add a new key-value pair to the dictionary.

Type declaration

    • (key: string, obj: AddValueObjType): Promise<void>
    • Parameters

      • key: string

        The input key string.

      • obj: AddValueObjType

        The input value object.

      Returns Promise<void>

destroy: () => Promise<void>

Destroy the current object.

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

getArray: (key: string) => Promise<null | PDFArrayType>

Get an array object specified by key.

Type declaration

    • (key: string): Promise<null | PDFArrayType>
    • Parameters

      • key: string

        The input key string.

      Returns Promise<null | PDFArrayType>

      Return an array object specified by key.

getBoolean: (key: string, defaultBool?: boolean) => Promise<boolean>

Get the boolean value for the element specified by key.

Type declaration

    • (key: string, defaultBool?: boolean): Promise<boolean>
    • Parameters

      • key: string

        The input key string.

      • OptionaldefaultBool: boolean

        The default boolean value. Default value is false.

      Returns Promise<boolean>

      Return the boolean value for the element specified by key.

getCount: () => Promise<number>

Get the number of elements in the dictionary.

Type declaration

    • (): Promise<number>
    • Returns Promise<number>

      Return the number of elements in the dictionary.

getDict: (key: string) => Promise<null | PDFDictionaryType>

Get a dictionary object specified by key.

Type declaration

    • (key: string): Promise<null | PDFDictionaryType>
    • Parameters

      • key: string

        The input key string.

      Returns Promise<null | PDFDictionaryType>

      Return a dictionary object specified by key.

getElement: (key: string) => Promise<null | PDFObjectType>

Get the object at the specified index.

Type declaration

    • (key: string): Promise<null | PDFObjectType>
    • Parameters

      • key: string

        The index to be get.

      Returns Promise<null | PDFObjectType>

      Return the object at the specified index.

getElementValue: (key: string) => Promise<null | PDFObjectType>

Returns direct or referred indirect object.

Type declaration

    • (key: string): Promise<null | PDFObjectType>
    • Parameters

      • key: string

        The input key string.

      Returns Promise<null | PDFObjectType>

      Returns direct or referred indirect object.

getFloat: (key: string) => Promise<number>

Get float value.

Type declaration

    • (key: string): Promise<number>
    • Parameters

      • key: string

        The input key string.

      Returns Promise<number>

      Return the float value for the element specified by key.

getInteger: (key: string, defaultInt: number) => Promise<number>

Get the integer value for the element specified by key.

Type declaration

    • (key: string, defaultInt: number): Promise<number>
    • Parameters

      • key: string

        The input key string.

      • defaultInt: number

        The default integer value.

      Returns Promise<number>

      Return the integer value for the element specified by key.

getInteger64: (key: string) => Promise<number>

Get the 64-bit integer value for the element specified by key.

Type declaration

    • (key: string): Promise<number>
    • Parameters

      • key: string

        The input key string.

      Returns Promise<number>

      Return the 64-bit integer value for the element specified by key.

getMatrix: (key: string) => Promise<Matrix>

Get the matrix value for the element specified by key.

Type declaration

    • (key: string): Promise<Matrix>
    • Parameters

      • key: string

        The input key string.

      Returns Promise<Matrix>

      Return the matrix value for the element specified by key.

getName: (key: string) => Promise<null | PDFObjectType>

Get the name object for the element specified by key.

Type declaration

    • (key: string): Promise<null | PDFObjectType>
    • Parameters

      • key: string

        The input key string.

      Returns Promise<null | PDFObjectType>

      Return the name object for the element specified by key.

getNumber: (key: string) => Promise<number>

Get the number value for the element specified by key.

Type declaration

    • (key: string): Promise<number>
    • Parameters

      • key: string

        The input key string.

      Returns Promise<number>

      Return the number value for the element specified by key.

getRect: (key: string) => Promise<Rect>

Get the rectangle value for the element specified by key.

Type declaration

    • (key: string): Promise<Rect>
    • Parameters

      • key: string

        The input key string.

      Returns Promise<Rect>

      Return the rectangle value for the element specified by key.

getString: (key: string) => Promise<string>

Get the string object for the element specified by key.

Type declaration

    • (key: string): Promise<string>
    • Parameters

      • key: string

        The input key string.

      Returns Promise<string>

      Return the string object for the element specified by key.

getUnicodeText: (key: string) => Promise<string>

Get the unicode text for the element specified by key.

Type declaration

    • (key: string): Promise<string>
    • Parameters

      • key: string

        The input key string.

      Returns Promise<string>

      Return the unicode text for the element specified by key.

isIdentical: (otherDict: PDFDictionaryType) => Promise<boolean>

Compare value with another object.

Type declaration

    • (otherDict: PDFDictionaryType): Promise<boolean>
    • Parameters

      Returns Promise<boolean>

      Return true if the two objects are the same, otherwise return false.

keyExist: (key: string) => Promise<boolean>

Check if the key exists in the dictionary.

Type declaration

    • (key: string): Promise<boolean>
    • Parameters

      • key: string

        The input key string.

      Returns Promise<boolean>

      Return true if the key exists in the dictionary, otherwise return false.

options: Options
removeAt: (key: string) => Promise<void>

Remove the element specified by key.

Type declaration

    • (key: string): Promise<void>
    • Parameters

      • key: string

        The input key string.

      Returns Promise<void>

replaceKey: (oldKey: string, newKey: string) => Promise<void>

Replace the key of the element specified by key with new key string.

Type declaration

    • (oldKey: string, newKey: string): Promise<void>
    • Parameters

      • oldKey: string

        The old key string.

      • newKey: string

        The new key string.

      Returns Promise<void>

setAt: (key: string, obj: PDFObjectType, doc: DocType) => Promise<void>

Setting element data.

Type declaration

    • (key: string, obj: PDFObjectType, doc: DocType): Promise<void>
    • Parameters

      • key: string

        The input key string.

      • obj: PDFObjectType

        The input element data.,type is PDFObjectType。

      • doc: DocType

        The input document object.

      Returns Promise<void>

setAtBoolean: (key: string, bool: boolean) => Promise<void>

Set a boolean value of boolean object for the element specified by key.

Type declaration

    • (key: string, bool: boolean): Promise<void>
    • Parameters

      • key: string

        The input key string.

      • bool: boolean

        The boolean value.

      Returns Promise<void>

setAtInteger: (key: string, num: number) => Promise<void>

Set a 32-bit integer of number object for the element specified by key.

Type declaration

    • (key: string, num: number): Promise<void>
    • Parameters

      • key: string

        The input key string.

      • num: number

        The number value.

      Returns Promise<void>

setAtMatrix: (key: string, matrix: Matrix) => Promise<void>

Set a matrix object for the element specified by key.

Type declaration

    • (key: string, matrix: Matrix): Promise<void>
    • Parameters

      • key: string

        The input key string.

      • matrix: Matrix

        The input matrix object.

      Returns Promise<void>

setAtName: (key: string, name: string) => Promise<void>

Set a string of name object for the element specified by key.

Type declaration

    • (key: string, name: string): Promise<void>
    • Parameters

      • key: string

        The input key string.

      • name: string

        The name string.

      Returns Promise<void>

setAtNumber: (key: string, num: number) => Promise<void>

Set a number object for the element specified by key.

Type declaration

    • (key: string, num: number): Promise<void>
    • Parameters

      • key: string

        The input key string.

      • num: number

        The number value.

      Returns Promise<void>

setAtRect: (key: string, rect: Rect) => Promise<void>

Set a rectangle for the element specified by key.

Type declaration

    • (key: string, rect: Rect): Promise<void>
    • Parameters

      • key: string

        The input key string.

      • rect: Rect

        The input rectangle object.

      Returns Promise<void>

setAtReference2ToDoc: (
    key: string,
    doc: DocType,
    obj: PDFObjectType,
) => Promise<void>

Set a reference object for the element specified by key.

Type declaration

    • (key: string, doc: DocType, obj: PDFObjectType): Promise<void>
    • Parameters

      • key: string

        The input key string.

      • doc: DocType

        The input document object.

      • obj: PDFObjectType

        The referred object for the reference object.

      Returns Promise<void>

setAtReferenceToDoc: (
    key: string,
    doc: DocType,
    objNum: number,
) => Promise<void>

Set a reference object for the element specified by key.

Type declaration

    • (key: string, doc: DocType, objNum: number): Promise<void>
    • Parameters

      • key: string

        The input key string.

      • doc: DocType

        The input document object.

      • objNum: number

        The referred object number for the reference object.

      Returns Promise<void>

setAtString: (key: string, str: string) => Promise<void>

Set a string of string object for the element specified by key.

Type declaration

    • (key: string, str: string): Promise<void>
    • Parameters

      • key: string

        The input key string.

      • str: string

        The string value.

      Returns Promise<void>

setNewAt: (key: string, objectType: number) => Promise<null | PDFObjectType>

Allocate by object_type and set object element at specified position.

Type declaration

    • (key: string, objectType: number): Promise<null | PDFObjectType>
    • Parameters

      • key: string

        The input key string.

      • objectType: number

        The object type. Like below:

        • DefineConst.FPD_OBJ_INVALID
        • DefineConst.FPD_OBJ_BOOLEAN
        • DefineConst.FPD_OBJ_NUMBER
        • DefineConst.FPD_OBJ_STRING
        • DefineConst.FPD_OBJ_NAME
        • DefineConst.FPD_OBJ_ARRAY
        • DefineConst.FPD_OBJ_DICTIONARY
        • DefineConst.FPD_OBJ_STREAM
        • DefineConst.FPD_OBJ_NULL
        • DefineConst.FPD_OBJ_REFERENCE

      Returns Promise<null | PDFObjectType>

Methods

  • Get the start position of the indirect objects.

    Returns Promise<null | POSITION>

    Return the start position of the indirect objects.