Interface representing a file instance with various properties and methods for file manipulation.

interface FileInstance {
    Copy: ((newName: string, newTarget: FileDirectory) => FileInstance);
    CreatePdfWithDynamicTemplate: ((templateXml: string) => boolean);
    CreationTimeUtc: Date;
    Delete: (() => boolean);
    Exists: boolean;
    Extension: string;
    FileSize: number;
    FullName: string;
    GetBase64: (() => boolean);
    GetSha256: (() => boolean);
    LastAccessTimeUtc: Date;
    LastWriteTimeUtc: Date;
    LoadBinary: (() => []);
    LoadMetaData: ((metaData?: MetaDataToLoad) => JobMetaDataInstanceObject);
    LoadText: (() => string);
    MimeType: string;
    Move: ((newName: string, newTarget: FileDirectory) => boolean);
    Name: string;
    OpenAsPdfDocument: ((password?: string) => PdfInstance);
    SaveBase64: ((base64: string) => boolean);
    SaveBinary: ((data: []) => boolean);
    SaveText: ((text: string) => boolean);
}

Properties

Copy: ((newName: string, newTarget: FileDirectory) => FileInstance)

Copies the file to a new location.

Type declaration

    • (newName, newTarget): FileInstance
    • Parameters

      • newName: string

        The new name of the file.

      • newTarget: FileDirectory

        The target directory to copy the file to.

      Returns FileInstance

      The copied file instance.

CreatePdfWithDynamicTemplate: ((templateXml: string) => boolean)

Creates a PDF from a dynamic template.

Type declaration

    • (templateXml): boolean
    • Parameters

      • templateXml: string

        The XML string defining the template.

      Returns boolean

      true if the operation is successful, otherwise false.

CreationTimeUtc: Date

Gets the creation time of the file in UTC.

Delete: (() => boolean)

Deletes the file.

Type declaration

    • (): boolean
    • Returns boolean

      true if the file was successfully deleted, otherwise false.

Exists: boolean

Indicates whether the file exists.

Extension: string

Gets the file extension.

FileSize: number

Gets the size of the file in bytes.

FullName: string

Gets the full name (including path) of the file.

GetBase64: (() => boolean)

Gets the base64 representation of the file.

Type declaration

    • (): boolean
    • Returns boolean

      true if the operation is successful, otherwise false.

GetSha256: (() => boolean)

Gets the SHA-256 hash of the file.

Type declaration

    • (): boolean
    • Returns boolean

      true if the operation is successful, otherwise false.

LastAccessTimeUtc: Date

Gets the last access time of the file in UTC.

LastWriteTimeUtc: Date

Gets the last write time of the file in UTC.

LoadBinary: (() => [])

Loads binary data from the file.

Type declaration

    • (): []
    • Returns []

      The loaded binary data.

LoadMetaData: ((metaData?: MetaDataToLoad) => JobMetaDataInstanceObject)

Loads metadata from the file.

Type declaration

LoadText: (() => string)

Loads text content from the file.

Type declaration

    • (): string
    • Returns string

      The loaded text content.

MimeType: string

Gets the MIME type of the file.

Move: ((newName: string, newTarget: FileDirectory) => boolean)

Moves the file to a new location.

Type declaration

    • (newName, newTarget): boolean
    • Parameters

      • newName: string

        The new name of the file.

      • newTarget: FileDirectory

        The target directory to move the file to.

      Returns boolean

      true if the file was successfully moved, otherwise false.

Name: string

Gets the name of the file.

OpenAsPdfDocument: ((password?: string) => PdfInstance)

Opens the file as a PDF document.

Type declaration

    • (password?): PdfInstance
    • Parameters

      • Optionalpassword: string

        Optional. The password to open the PDF document.

      Returns PdfInstance

      The PDF instance.

SaveBase64: ((base64: string) => boolean)

Saves base64 content to the file.

Type declaration

    • (base64): boolean
    • Parameters

      • base64: string

        The base64 content to save.

      Returns boolean

      true if the operation is successful, otherwise false.

SaveBinary: ((data: []) => boolean)

Saves binary data to the file.

Type declaration

    • (data): boolean
    • Parameters

      • data: []

        The binary data to save.

      Returns boolean

      true if the operation is successful, otherwise false.

SaveText: ((text: string) => boolean)

Saves text content to the file.

Type declaration

    • (text): boolean
    • Parameters

      • text: string

        The text content to save.

      Returns boolean

      true if the operation is successful, otherwise false.