-
Notifications
You must be signed in to change notification settings - Fork 189
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
Export and import annotations (annotations imported and placed on the wrong position) #1825
Comments
The offset is the same offset used by the copy-and-paste feature. That might be a clue. |
unfortunately I ve the same issue. const serializedAnnotations = this.pdfService.getSerializedAnnotations();
this.pdfService.removeEditorAnnotations();
this.pdfService.addEditorAnnotation(serializedAnnotations[0]); the inserted annotation wont be placed at the original position |
I have the same issue, when copy-pasting it works fine, but where can I adjust the offset? The pasted annotation is always moved to the bottom right for the exact height & width of the annotation. |
By now, I'm pretty sure that the offset is caused by me being lazy. I used the "paste" part of the copy-and-paste implementation of the editors. Unfortunately, yesterdays debugging session didn't reveal where the offset is added. Maybe you can help me? During the next two or three weeks I'm short of time, so I'd appreciate your time. Set Thanks in advance, |
Found it! I've managed to solve the issue, at least for drawings. It'll take a few days to fix it for texts and stamps, but after the first breakthrough it should be easy. |
…ions to another coordinate
…ions to another coordinate
Your bugfix has landed with version 18.0.0-beta.2. Please note that the internal coordinates of the serialized drawings have changed. This caught me by surprise, too, and it took a while until I figured it out. The |
…ions to new coordinates
…ions to new coordinates
Oops. The version only fixed the ink editor. Version 18.0.0-beta.3 fixes the offset for all three editors. The showcase often shows an offset of 2 units. I don't know where this comes from. But at least it's a predictable offset now, and chances are it's caused by the showcase and not by the library itself. |
…itor annotations interactively
…itor annotations interactively
great job, thanks a lot. Annotations are placed at origin position now. behavior is the same for both text annotations and draw annotations |
What? Oh no! That's unexpected. As a short-term workaround, use |
yes indeed, I allready tryed this workaround, for instance like this: annotations.forEach(a => {
this.scroll(a.pageIndex+1,0)
this.pdfService.addEditorAnnotation(a);
}); it works fine so far |
…vice.addEditorAnnotation()` respects the `pageIndex`if it's defined in the annotation: otherwise, the annotation is added to the current page
…vice.addEditorAnnotation()` respects the `pageIndex`if it's defined in the annotation: otherwise, the annotation is added to the current page
I haven't published it yet, but version 18.0.0-beta.5 is going to fix that. Most likely, I'm going to publish the version this week-end, so I'm closing the ticket now. |
First of all thank you for your work!
We have the case to store and restore the annotations on the pdf. if you try to restore the annotation, the anntation would created in the right size, but placed on the wrong position. It is offset by the size of the annotation.
Steps for recreating the bug:
There you have the bug - placed on the wrong position
The text was updated successfully, but these errors were encountered: