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

Add a high level feature for creating in-page anchors #689

Open
practicingruby opened this issue Mar 6, 2014 · 6 comments
Open

Add a high level feature for creating in-page anchors #689

practicingruby opened this issue Mar 6, 2014 · 6 comments

Comments

@practicingruby
Copy link
Member

RIght now using anchors in Prawn relies on digging down into the very low level PDF::Core::Destinations code, and it shouldn't have to. For this reason, I actually undocumented anchors in our manual and API docs.

I started an experiment to implement higher level functionality in #684, but then realized I'd rather someone who has a practical use case for anchors take a stab at building an API for them. Until then, our support for anchors should be considered mostly unsupported.

Suggestions are welcome on this, and it might be an easy patch for someone new to the project.

@practicingruby
Copy link
Member Author

Note that #683 is still a valid issue currently, I've only closed it because until we have a legitimate high level interface to support, it's a bug in the internals rather than in something that is officially part of Prawn's external API. A patch is still welcome, and I will reopen #683 when we find a solution for this ticket.

@practicingruby
Copy link
Member Author

Should also consider adding a higher level interface for making external links to, particularly for use w. images

@practicingruby
Copy link
Member Author

Bumping this just because I've ran into the problem myself several times.

@mojavelinux
Copy link
Contributor

I can also add that many users of Asciidoctor PDF are requesting a feature that depends on it. See asciidoctor/asciidoctor-pdf#56. I've hacked in some support for linking to sections, but references are not generally available atm.

@practicingruby
Copy link
Member Author

@mojavelinux:

Here's how I implemented cross-references in a small project I'm currently working on:

add_dest "LinkedSection", dest_xyz(bounds.absolute_left, y)

# somewhere else in the document
text  '<link anchor="LinkedSection">Click me!</link>', :inline_format => true

So... we have the raw tools in place, they're just awkward to use. I'll give some thought into how to wrap them nicely, but proposals are welcome.

@mojavelinux
Copy link
Contributor

Great! Thanks!

As I work on the feature, I'll let you know if any instincts about an API
emerge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants