Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add pdf annotation support #6289

Draft
wants to merge 8 commits into
base: feat/pdf-support
Choose a base branch
from

Conversation

doouding
Copy link
Member

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];
};

Copy link

vercel bot commented Feb 23, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

1 participant