Some basic PDF hyperlink support

I’ve started to add some hyperlinks to the multipage PDF output, now that CairoGraphics and PyCairo support this.

For now only the “next page” arrows on the edges of the detail map pages are linked to the target pages in the PDF:

align=right

UPDATE: The page rectangles on the overview now link to the detail pages, too

In the future the page numbers in the overview grid, and the index entries should also link to the related detail pages.

There were some show stoppers I ran into while trying to add hyperlinks, some not resolved yet.

  • originally there was no hyper link support in Cairo at all, it was only added with Cairo 1.15.10 and above
  • Python binding support was only added in PyCairo 1.18.0. Unlike the base Cairo version 1.15.10 this is not yet in latest Ubuntu releases. So this required manual install.
  • Pango does not support this at all yet, so in places where MapOSMatic/OCitysMap uses Pango to render text instead of raw Cairo functions hyperlinks don’t work yet

So full support for clickable page numbers will still take some time to complete, but at least the most basic part is implemented now.

One thought on “Some basic PDF hyperlink support”

Leave a Reply

Your email address will not be published. Required fields are marked *