Implements

Constructors

  • Create a Parser instance. Instead of creating an instance in new mode, use create to create an instance.

    Parameters

    • Optionaloptions: Options

      Create a Parser instance with the specified options.

    Returns Parser

    const parser = await Parser.create();
    

Properties

options?: Options

Methods

  • Close the parser.

    Parameters

    • reParse: boolean = false

      Close the parser, as well as the file. If reparsing is used, the document will be kept. Default is false.

    Returns Promise<void>

  • Destroy the current object.

    Returns Promise<void>

  • Get the document object.

    Returns Promise<null | DocType>

    Return the document object.

  • Get the last object number.

    Returns Promise<number>

    Return the last object number.

  • Get the password.

    Returns Promise<string>

    Return the password.

  • Get the root object number.

    Returns Promise<number>

    Return the root object number.

  • Whether the user has the owner permission of the document.

    Returns Promise<boolean>

    Return true if the user has the owner permission of the document, otherwise return false.

  • Set the password.

    Parameters

    • password: string

      The password to be set.

    Returns Promise<void>

    const parser = await Parser.create();
    const status = await parser.startParse('d://xxx.pdf', false);
    if (status === FPD_PARSE_ERROR_PASSWORD) {
    parser.setPassword('123456');
    status = await parser.startParse('d://xxx.pdf', false);
    }
  • Create a Parser instance.

    Parameters

    • Optionaloptions: Options

      Create a Parser instance with the specified options.

    Returns Promise<ParserType>

    const parser = await Parser.create();