-
Notifications
You must be signed in to change notification settings - Fork 196
Annotation are not loading for highlight #2345
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
Comments
To be honest, I haven't tried adding highlights programmatically yet. I'm sure it's possible, but that's all I know. My best guess is you've forgotten an attribute, used wrong values, or something like this. Adding annotations programmatically is a low-level API that may change at any point in time, so you're in danger zone if you're using it. The best way to figure out the correct JSON object is reverse engineering. Add a highlight, export it to a JSON object, and play around with it. Sometimes pdf.js is very capricious - for example, if the coordinate are slightly off, it may refuse to render anything at all. That said, how did you define your |
@stephanrauh Thank you so much, I appreciate your acknowledgement. below is some of the information that might help,
where type
and this is the object we are passing to be rendered
I have got this from export function we have, which is |
I am having the same exact problem. Do you also get warning messages such as |
It is giving me something like |
The difference between "t is not iterable" and "boxes is not iterable" may be that one of you is using the minified JavaScript files and the other is not. For debugging or reporting errors, please use the non-minified files. That makes everything a lot easier. The attribute I'm referring to is |
@DayibBaba Your new ticket (#2355) indicates you've managed to solve this issue. Do you have new insight you can share with us? |
The images in ticket #2355 showcase a little trick that uses a different annotation method to mimic a highlight. Its essentially a drawing with adjusted opacity. |
Oh, ok. Yeah, I already wondered about the squiggly highlight. :) |
I've finally managed to have a look at your issue. I'm afraid I've got bad news. You can't add highlights programmatically because the API I was using simply doesn't work. This, in turn, is because you can't copy and paste highlights, so the programmers didn't care about that and didn't implement the paste API properly. The JSON object you get by exporting the highlight is pretty much useless. In the long run, I'm not ready to accept that, but in the short term, I'm not able to provide a solution. The only thing I can currently do is documenting that adding highlights is not possible. |
…hts programmatically is not supported yet
I've reluctantly published that highlights aren't supported yet. Just out of curiosity: would you pay money for this feature? I'm a consultant, so paying me for programming is always an option, even though this project is strictly non-commercial. |
We are willing to do a sponsor on this, are you still open to this? @stephanrauh |
@ldu2 Well, maybe. At the moment, I'd have to talk my employer into it, so we're talking about an international contract. I don't know if they do this, but I can ask. Which country do you live in? |
We are in the US. |
@stephanrauh if it's appearing to be problematic, is it possible for you to give me some pointers where I can start to look at and dig into? I'd really appreciate it. Let me know. Thanks! |
I need your help!
Need your help in loading the annotations which are saved before.
Check this first
The pdf Viewer Service has the function to load the annotations
addEditorAnnotation()
Describe the bug
addEditorAnnotation(highlight)
Version info
The text was updated successfully, but these errors were encountered: