-
Notifications
You must be signed in to change notification settings - Fork 182
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
Popover remove or modification #2164
Comments
By the way, your upper-most screenshot shows you've got a CSS problem. The latest version of ngx-extended-pdf-viewer aligns the icon and the text nicely: |
@stephanrauh Thank you!, i really appreciate your help |
I've started to investigate your third issue. That's quite a rabbit hole. At the moment I've identified roughly 16 different events. Maybe that's 32, if I consider the undo function. Is it OK if the events fire after finishing the operation? I didn't find a good hook to fire an event when the user clicks the menu to add an annotation. But I think that'd be useless, anyways, because it's only an empty annotation. |
@stephanrauh First.. thank you for your effort, i would like to point on some few things i did might help..
so in this case we know that user wanted to draw... and if i want to turn that draw mode off simply i will change the mode to ZERO.
if the the current class list contains a class called 'stampEditing' for example, now we know that the text layer is not available at this moment and user still adding annotations. For me i found this solution helpful, maybe it's not optimal but it does the job and i can wrap up every thing around me to make decisions about what the user should do after adding the annotation like fetching the serialized annotations and send them using API for example after the annotation mode changed to zero. Please Check this out, i did this using ngx extended pdf viewer 85bc5930-a29c-43ca-989d-927ac7b5ae44.mp4The last thing i need to know is when i triggered annotation mode 9 (Highlighting) i saw that it sets a multi span selected lines as one annotation, can i ask you how you did that ? i mean how did you applied that highlight style to that selected lines because i want to expand this thing and i want to add Underline, Squiggle and Strikethrough. I know i went too far with my questions but i'm really enjoying this library |
I didn't. :) @Calixtheman implemented this. If you want to implement underline, squiggle, and strikethrough, it might be a good idea to have a chat with them. Maybe they're ready to pick up the idea and to implement it in the base library (or to accept a PR doing that). |
How did you implement the sticky notes? |
Adding sticky notes process comes in two stages..
Why i append it to text layer ? because i'm enabling text layer in order to select and highlight some text so in this case the first thing user will hit when the page being clicked is the text layer :) Now he can select it and see it's content or apply Drag&Drop events so he can change the original annotation Rectangle values. How did i get the current user click position based on the pdf page ? const PDFViewerApplication: IPDFViewerApplication = (window as any).PDFViewerApplication;
const pageIndex = annotation.page;
const pageView = PDFViewerApplication.pdfViewer.getPageView(pageIndex);
const currentCanvas = pageView.canvas!.parentElement
const currentTextLayer = pageView.textLayer
const screenRect = pageView.viewport.convertToViewportRectangle(annotation.rect)
const viewportWidth = pageView.viewport.width;
const viewportHeight = pageView.viewport.height;
const xPercent = (screenRect[0] / viewportWidth) * 100;
const yPercent = (screenRect[1] / viewportHeight) * 100;
const fakeStickyNote = document.createElement('section')
let isDragging = false;
let shouldAppend = true
let initialX = 0
let initialY = 0;
fakeStickyNote.style.setProperty('left', `${xPercent - 2}%`);
fakeStickyNote.style.setProperty('top', `${yPercent - 2}%`);
fakeStickyNote.style.position = 'absolute';
fakeStickyNote.style.cursor = 'grab'
fakeStickyNote.draggable = true; |
@farisshomali |
@roshrj-hue Please read my response above, i described the process in two steps |
Hi, I have multiple questions...
3, How can i detect events when user add annotation ?
Many thanks :)
The text was updated successfully, but these errors were encountered: