-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add link tags for pdfs #2405
base: master
Are you sure you want to change the base?
Add link tags for pdfs #2405
Conversation
43b974d
to
55068c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is sort of like addHitRegion()
(RIP) or the proposed HitRegionSet
(whatwg/html#3407).
If we add a non-standard API (generally avoided), we should make sure it covers all foreseeable use cases to avoid having to add another non-standard API in the future. In this case, we might want to (prepare to) expose the full Cairo API for tags (i.e. support specifying an array of rects as the hit region).
+0 from me.
These proposals seem to mostly be dead or nearly dead, I think the best thing would just to avoid being close to them in any naming
I agree, I think would be good to be able to support the different tag types that cairo can support. I see a couple of options
I've be very happy to adjust this implementation to something that can work along these lines |
@zbjornson I've made some changes to make it simple for this API to be extended in the future. I've kept only support for Link with uri, and leave it as a task for someone who needs it to add support for more types, but with the object based config for tag, this should be simple to do. I've also added escaping and check for ascii. |
e9ceca8
to
1abe048
Compare
@chearon would you review this? |
Interested to see if people think this is a reasonable implementation.
I went with as simple as possible based off https://www.cairographics.org/manual/cairo-Tags-and-Links.html#link
I know its not standard api, but there isn't one for this in canvas, and as was mentioned in the linked issue the project should be open to such an addition.
Fixes #2044