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>

添加注释对象。

Type declaration

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

删除注释对象。

Type declaration

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

      Returns Promise<boolean>

      如果注释被成功删除则返回 true,否则返回 false。

destroy: () => Promise<void>

销毁当前对象。

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

将矩形从设备空间转换为用户空间。

Type declaration

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

      Returns Promise<Rect>

      返回一个用户空间的矩形。

doc: null | DocType

关联的文档对象。

docView: null | DocViewType

关联的文档视图对象。

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

获取指定点位置的注释对象。

Type declaration

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

      • point: Point

        要获取注释的点。

      • subType: string

        注释的子类型。

      Returns Promise<null | AnnotType>

      返回注释对象。

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>

通过索引获取注释对象。

Type declaration

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

      • index: number

        注释的索引。

      Returns Promise<null | AnnotType>

      返回注释对象。

getAnnotCount: () => Promise<number>

获取当前页面视图上的注释数量。

Type declaration

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

      返回当前页面视图上的注释数量。

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

获取当前页面视图的注释列表。

Type declaration

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

      返回当前页面视图的注释列表。

getCurrentMatrix: () => Promise<Matrix>

获取当前页面视图的矩阵。

Type declaration

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

      返回当前页面视图的矩阵。

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

获取文档对象。

Type declaration

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

      返回文档对象。

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

获取文档视图对象。

Type declaration

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

获取当前聚焦的注释对象。

Type declaration

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

      返回当前聚焦的注释对象。

getPageIndex: () => Promise<number>

获取当前页面视图的页索引。

Type declaration

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

      返回当前页面视图的页索引。

getPageRect: () => Promise<Rect>

获取当前页面视图的矩形区域。

Type declaration

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

      返回当前页面视图的矩形区域。

getPageScale: () => Promise<number>

获取当前页面视图的缩放比例。

Type declaration

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

      返回当前页面视图的缩放比例。

getPageVisibleRect: () => Promise<Rect>

获取当前页面视图的可见矩形。

Type declaration

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

      返回当前页面视图的可见矩形。

options?: Options
page: null | PageType

关联的页面对象。

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

将矩形从用户空间转换为设备空间。

Type declaration

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

      • pageRect: Rect

        一个用户空间的矩形,其坐标将被转换为设备空间。

      Returns Promise<Rect>

      返回一个设备空间的矩形。

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

将当前页面视图渲染为位图。

Type declaration

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

      Returns Promise<boolean>

      返回渲染结果,true 表示成功,false 表示失败。

Methods

  • 获取页面对象。

    Returns Promise<null | PageType>

    返回页面对象。