interface PageViewType {
    addAnnot: (
        annotDict: PDFDictionaryType,
        index: number,
    ) => Promise<null | AnnotType>;
    deleteAnnot: (annot: AnnotType) => Promise<boolean>;
    destroy: () => Promise<void>;
    deviceRectToPage: (rect: Rect) => Promise<Rect>;
    doc: null | DocType;
    docView: null | DocViewType;
    getAnnotAtPoint: (
        point: Point,
        subType: string,
    ) => Promise<null | AnnotType>;
    getAnnotByIndex: (index: number) => Promise<null | AnnotType>;
    getAnnotCount: () => Promise<number>;
    getAnnotList: () => Promise<AnnotType[]>;
    getCurrentMatrix: () => Promise<Matrix>;
    getDoc: () => Promise<null | DocType>;
    getDocView: () => Promise<null | DocViewType>;
    getFocusAnnot: () => Promise<null | AnnotType>;
    getPageIndex: () => Promise<number>;
    getPageRect: () => Promise<Rect>;
    getPageScale: () => Promise<number>;
    getPageVisibleRect: () => Promise<Rect>;
    options?: Options;
    page: null | PageType;
    rectToDevice: (pageRect: Rect) => Promise<Rect>;
    renderToBitmap: (bitmap: DIBitmapType, rect: Rect) => Promise<boolean>;
    getPage(): Promise<null | PageType>;
}

Implemented by

Properties

addAnnot: (
    annotDict: PDFDictionaryType,
    index: number,
) => Promise<null | AnnotType>

Add an annotation object.

Type declaration

deleteAnnot: (annot: AnnotType) => Promise<boolean>

Delete the annotation object.

Type declaration

    • (annot: AnnotType): Promise<boolean>
    • Parameters

      Returns Promise<boolean>

      Return true if the annotation is deleted successfully, otherwise return false.

destroy: () => Promise<void>

Destroy the current object.

deviceRectToPage: (rect: Rect) => Promise<Rect>

Transforms a rectangle from device space to user space.

Type declaration

    • (rect: Rect): Promise<Rect>
    • Parameters

      Returns Promise<Rect>

      Return a user space rectangle.

doc: null | DocType

Associated document object.

docView: null | DocViewType

Associated document view object.

getAnnotAtPoint: (point: Point, subType: string) => Promise<null | AnnotType>

Get the annotation object at the specified point.

Type declaration

    • (point: Point, subType: string): Promise<null | AnnotType>
    • Parameters

      • point: Point

        The point to get the annotation.

      • subType: string

        The subtype of the annotation.

      Returns Promise<null | AnnotType>

      Return the annotation object.

let doc = await app.GetActiveDocOfPDDoc();
let docview = await doc.GetDocView(doc,0);
let pageview = await docview.GetCurrentPageView(docview);
const pt = {
x: 10,
y: 10
}
await pageview.GetAnnotAtPoint(pageview,new FS_DevicePoint(pt),"Highlight");
getAnnotByIndex: (index: number) => Promise<null | AnnotType>

Get the annotation object by index.

Type declaration

    • (index: number): Promise<null | AnnotType>
    • Parameters

      • index: number

        The index of the annotation.

      Returns Promise<null | AnnotType>

      Return the annotation object.

getAnnotCount: () => Promise<number>

Get the number of annotations on the current pageview.

Type declaration

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

      Return the number of annotations on the current pageview.

getAnnotList: () => Promise<AnnotType[]>

Get the annotation list of the current pageview.

Type declaration

    • (): Promise<AnnotType[]>
    • Returns Promise<AnnotType[]>

      Return the annotation list of the current pageview.

getCurrentMatrix: () => Promise<Matrix>

Get the current matrix of the page view.

Type declaration

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

      Return the current matrix of the page view.

getDoc: () => Promise<null | DocType>

Get the document object.

Type declaration

    • (): Promise<null | DocType>
    • Returns Promise<null | DocType>

      Return the document object.

getDocView: () => Promise<null | DocViewType>

Get the document view object.

Type declaration

getFocusAnnot: () => Promise<null | AnnotType>

Get the focus annotation object.

Type declaration

    • (): Promise<null | AnnotType>
    • Returns Promise<null | AnnotType>

      Return the focus annotation object.

getPageIndex: () => Promise<number>

Get the page index of the current pageview.

Type declaration

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

      Return the page index of the current pageview.

getPageRect: () => Promise<Rect>

Get the rectangle of the current pageview.

Type declaration

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

      Return the rectangle of the current pageview.

getPageScale: () => Promise<number>

Get the scale of the current pageview.

Type declaration

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

      Return the scale of the current pageview.

getPageVisibleRect: () => Promise<Rect>

Get the visible rectangle of the current pageview.

Type declaration

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

      Return the visible rectangle of the current pageview.

options?: Options
page: null | PageType

Associated page object.

rectToDevice: (pageRect: Rect) => Promise<Rect>

Transforms a rectangle from user space to device space.

Type declaration

    • (pageRect: Rect): Promise<Rect>
    • Parameters

      • pageRect: Rect

        A user space rectangle whose coordinates are transformed to device space.

      Returns Promise<Rect>

      Return a device space rectangle.

renderToBitmap: (bitmap: DIBitmapType, rect: Rect) => Promise<boolean>

Render the current page view to a bitmap.

Type declaration

    • (bitmap: DIBitmapType, rect: Rect): Promise<boolean>
    • Parameters

      • bitmap: DIBitmapType

        The target bitmap object.

      • rect: Rect

        The rectangle area object.

      Returns Promise<boolean>

      Return the rendering result, true indicates success, false indicates failure.

Methods

  • Get the page object.

    Returns Promise<null | PageType>

    Return the page object.