Represents a PDF instance with various methods and properties for PDF manipulation.

interface PdfInstance {
    AddAttachement: ((file: FileInstance) => boolean);
    AddPage: (() => PdfPage);
    AppendPdfFile: ((file: FileInstance) => boolean);
    Author: string;
    Clear: (() => void);
    Close: (() => void);
    CreateLayer: ((name: string, visible?: boolean, intent?: number) => PdfLayer);
    Creator: string;
    Custom: IPdfMetaData;
    DeletePage: ((index: number) => boolean);
    DeletePages: ((index: number, count: number) => boolean);
    DerivedFrom: Object;
    DocumentId: string;
    DrawDynamicTemplate: ((templateXml: string, startPage: number) => boolean);
    ExportFdf: ((file: FileInstance) => boolean);
    ExtractPages: ((target: FileInstance, pages: object) => boolean);
    ExtractText: ((asFormated: boolean) => string);
    FlattenControls: (() => boolean);
    GetLayerAt: ((index: number) => PdfLayer);
    GetPageAt: ((index: number) => PdfPage);
    ImageCount: number;
    ImportFdf: ((file: FileInstance) => boolean);
    InsertPage: ((index: number) => PdfPage);
    IsOpen: boolean;
    Keywords: string;
    LayerCount: number;
    ManagedFrom: {};
    Manager: string;
    MovePage: ((srcIndex: number, destIndex: number) => boolean);
    PageCount: number;
    PdfaConformance: string;
    Producer: string;
    RemoveSignaturePermissions: (() => boolean);
    RemoveStructureInformation: (() => boolean);
    RemoveTransparencyGroups: (() => boolean);
    Save: ((file?: FileInstance, createHumanReadable?: boolean, linearize?: boolean, producePdfA?: boolean, doNotSyncMetaData?: boolean) => boolean);
    SetPageSplitInformation: ((info: []) => boolean);
    Subject: string;
    SwapPages: ((firstIndex: number, secondIndex: number) => boolean);
    Title: string;
    VersionId: string;
}

Properties

AddAttachement: ((file: FileInstance) => boolean)

Adds an attachment to the PDF.

Type declaration

    • (file): boolean
    • Parameters

      Returns boolean

      true if the operation is successful, otherwise false.

AddPage: (() => PdfPage)

Adds a new page to the end of the PDF.

Type declaration

AppendPdfFile: ((file: FileInstance) => boolean)

Appends another PDF file to this PDF.

Type declaration

    • (file): boolean
    • Parameters

      Returns boolean

      true if the operation is successful, otherwise false.

Author: string

Gets or sets the author of the PDF.

Clear: (() => void)

Clears the PDF instance.

Close: (() => void)

Closes the PDF instance.

CreateLayer: ((name: string, visible?: boolean, intent?: number) => PdfLayer)

Creates a new layer in the PDF.

Type declaration

    • (name, visible?, intent?): PdfLayer
    • Parameters

      • name: string

        The name of the layer.

      • Optionalvisible: boolean

        Optional. The visibility of the layer. Defaults to true.

      • Optionalintent: number

        Optional. The intent for the layer.

      Returns PdfLayer

      The created layer object.

Creator: string

Gets or sets the creator of the PDF.

Custom: IPdfMetaData

Gets or sets custom metadata for the PDF.

DeletePage: ((index: number) => boolean)

Deletes the page at the specified index.

Type declaration

    • (index): boolean
    • Parameters

      • index: number

        The index of the page to delete.

      Returns boolean

      true if the operation is successful, otherwise false.

DeletePages: ((index: number, count: number) => boolean)

Deletes multiple pages starting from the specified index.

Type declaration

    • (index, count): boolean
    • Parameters

      • index: number

        The starting index of the pages to delete.

      • count: number

        The number of pages to delete.

      Returns boolean

      true if the operation is successful, otherwise false.

DerivedFrom: Object

Gets or sets the "Derived From" information of the PDF.

DocumentId: string

Gets or sets the document ID of the PDF.

DrawDynamicTemplate: ((templateXml: string, startPage: number) => boolean)

Draws a dynamic template on the PDF.

Type declaration

    • (templateXml, startPage): boolean
    • Parameters

      • templateXml: string

        The XML string defining the template.

      • startPage: number

        The starting page number for the template.

      Returns boolean

      true if the operation is successful, otherwise false.

ExportFdf: ((file: FileInstance) => boolean)

Exports FDF data from the PDF.

Type declaration

    • (file): boolean
    • Parameters

      Returns boolean

      true if the operation is successful, otherwise false.

ExtractPages: ((target: FileInstance, pages: object) => boolean)

Extracts pages from the PDF to another file.

Type declaration

    • (target, pages): boolean
    • Parameters

      • target: FileInstance

        The target file instance to extract pages to.

      • pages: object

        The pages to extract.

      Returns boolean

      true if the operation is successful, otherwise false.

ExtractText: ((asFormated: boolean) => string)

Extracts text from the PDF.

Type declaration

    • (asFormated): string
    • Parameters

      • asFormated: boolean

        Indicates whether to extract the text as formatted.

      Returns string

      The extracted text.

FlattenControls: (() => boolean)

Flattens interactive form fields and annotations.

Type declaration

    • (): boolean
    • Returns boolean

      true if the operation is successful, otherwise false.

GetLayerAt: ((index: number) => PdfLayer)

Gets the layer at the specified index.

Type declaration

    • (index): PdfLayer
    • Parameters

      • index: number

        The index of the layer.

      Returns PdfLayer

      The layer object at the specified index.

GetPageAt: ((index: number) => PdfPage)

Gets the page at the specified index.

Type declaration

    • (index): PdfPage
    • Parameters

      • index: number

        The index of the page.

      Returns PdfPage

      The page object at the specified index.

ImageCount: number

Gets the count of images in the PDF.

ImportFdf: ((file: FileInstance) => boolean)

Imports FDF data into the PDF.

Type declaration

    • (file): boolean
    • Parameters

      • file: FileInstance

        The file instance containing the FDF data.

      Returns boolean

      true if the operation is successful, otherwise false.

InsertPage: ((index: number) => PdfPage)

Inserts a new page at the specified index.

Type declaration

    • (index): PdfPage
    • Parameters

      • index: number

        The index at which to insert the page.

      Returns PdfPage

      The inserted page object.

IsOpen: boolean

Gets a value indicating whether the PDF is open.

Keywords: string

Gets or sets the keywords associated with the PDF.

LayerCount: number

Gets the count of layers in the PDF.

ManagedFrom: {}

Gets or sets the "Managed From" information of the PDF.

Manager: string

Gets or sets the manager of the PDF.

MovePage: ((srcIndex: number, destIndex: number) => boolean)

Moves a page from one index to another.

Type declaration

    • (srcIndex, destIndex): boolean
    • Parameters

      • srcIndex: number

        The source index of the page.

      • destIndex: number

        The destination index of the page.

      Returns boolean

      true if the operation is successful, otherwise false.

PageCount: number

Gets the count of pages in the PDF.

PdfaConformance: string

Gets the PDF/A conformance level of the PDF.

Producer: string

Gets or sets the producer of the PDF.

RemoveSignaturePermissions: (() => boolean)

Removes signature permissions from the PDF.

Type declaration

    • (): boolean
    • Returns boolean

      true if the operation is successful, otherwise false.

RemoveStructureInformation: (() => boolean)

Removes structure information from the PDF.

Type declaration

    • (): boolean
    • Returns boolean

      true if the operation is successful, otherwise false.

RemoveTransparencyGroups: (() => boolean)

Removes transparency groups from the PDF.

Type declaration

    • (): boolean
    • Returns boolean

      true if the operation is successful, otherwise false.

Save: ((file?: FileInstance, createHumanReadable?: boolean, linearize?: boolean, producePdfA?: boolean, doNotSyncMetaData?: boolean) => boolean)

Saves the PDF to a file.

Type declaration

    • (file?, createHumanReadable?, linearize?, producePdfA?, doNotSyncMetaData?): boolean
    • Parameters

      • Optionalfile: FileInstance

        Optional. The file instance to save to.

      • OptionalcreateHumanReadable: boolean

        Optional. Indicates whether to create a human-readable PDF.

      • Optionallinearize: boolean

        Optional. Indicates whether to linearize the PDF.

      • OptionalproducePdfA: boolean

        Optional. Indicates whether to produce a PDF/A.

      • OptionaldoNotSyncMetaData: boolean

        Optional. Indicates whether to skip syncing metadata.

      Returns boolean

      true if the operation is successful, otherwise false.

SetPageSplitInformation: ((info: []) => boolean)

Sets page split information.

Type declaration

    • (info): boolean
    • Parameters

      • info: []

        Array of page split information.

      Returns boolean

      true if the operation is successful, otherwise false.

Subject: string

Gets or sets the subject of the PDF.

SwapPages: ((firstIndex: number, secondIndex: number) => boolean)

Swaps two pages in the PDF.

Type declaration

    • (firstIndex, secondIndex): boolean
    • Parameters

      • firstIndex: number

        The index of the first page.

      • secondIndex: number

        The index of the second page.

      Returns boolean

      true if the operation is successful, otherwise false.

Title: string

Gets or sets the title of the PDF.

VersionId: string

Gets or sets the version ID of the PDF.