blocksuite icon indicating copy to clipboard operation
blocksuite copied to clipboard

feat: add pdf annotation support

Open doouding opened this issue 1 year ago • 1 comments

There are two types of annotation, one is TextAnnotation which allows you to select text in PDF and add comments on it; the other is ClipAnnotation which is basically an image.

export type ClipAnnotation = {
  type: AnnotationType.Clip;
  comment: Y.Text;
  highlightRects: Record<number, [number, number, number, number][]>;
};

export type TextAnnotation = {
  type: AnnotationType.Text;
  comment: Y.Text;
  /**
   * hightlighted rects in each page
   *
   * Rect<page, [x, y, w, h]>
   */
  highlightRects: Record<number, [number, number, number, number][]>;

  /**
   * The highlight text
   */
  text: string;
};

type ClipAnnotation = {
  type: AnnotationType.Clip;
  highlightRect: [number, number, number, number];
};

doouding avatar Feb 23 '24 12:02 doouding

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blocksuite ❌ Failed (Inspect) Feb 28, 2024 3:18am
blocksuite-docs ❌ Failed (Inspect) Feb 28, 2024 3:18am

vercel[bot] avatar Feb 23 '24 12:02 vercel[bot]

很期待的功能,请问为啥这个PR关闭了? 😩

TheChildWang avatar Sep 15 '24 06:09 TheChildWang