{"id":330,"date":"2018-12-02T16:14:31","date_gmt":"2018-12-02T16:14:31","guid":{"rendered":"https:\/\/blog.get-map.org\/?p=330"},"modified":"2018-12-02T17:27:43","modified_gmt":"2018-12-02T17:27:43","slug":"some-basic-pdf-hyperlink-support","status":"publish","type":"post","link":"https:\/\/blog.get-map.org\/index.php\/2018\/12\/02\/some-basic-pdf-hyperlink-support\/","title":{"rendered":"Some basic PDF hyperlink support"},"content":{"rendered":"<p><a name=\"preamble\"><\/a> <\/p>\n<p>I&#8217;ve started to add some hyperlinks to the multipage PDF output, now that CairoGraphics and PyCairo support this.<\/p>\n<p>For now only the &#8220;next page&#8221; arrows on the edges of the detail map pages are linked to the target pages in the PDF:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blog.get-map.org\/wp-content\/uploads\/2018\/12\/multipage-links.png\" style=\"border-width: 0; vertical-align: text-bottom;\" alt=\"align=right\"><\/p>\n<p><strong>UPDATE:<\/strong> The page rectangles on the overview now link to the detail pages, too<\/p>\n<p><!--more--><\/p>\n<p>In the future the page numbers in the overview grid, and the index entries should also link to the related detail pages.<\/p>\n<p>There were some show stoppers I ran into while trying to add hyperlinks, some not resolved yet.<\/p>\n<ul>\n<li> originally there was no hyper link support in Cairo at all, it was only added with Cairo 1.15.10 and above <\/li>\n<li> 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. <\/li>\n<li> Pango does not support this <a href=\"https:\/\/gitlab.gnome.org\/GNOME\/pango\/issues\/290\">at all yet<\/a>, so in places where MapOSMatic\/OCitysMap uses Pango to render text instead of raw Cairo functions hyperlinks don&#8217;t work yet <\/li>\n<\/ul>\n<p>So full support for <a href=\"https:\/\/github.com\/hholzgra\/maposmatic\/issues\/10\">clickable page numbers<\/a> will still take some time to complete, but at least the most basic part is implemented now.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve started to add some hyperlinks to the multipage PDF output, now that CairoGraphics and PyCairo support this. For now only the &#8220;next page&#8221; arrows on the edges of the detail map pages are linked to the target pages in the PDF: UPDATE: The page rectangles on the overview now link to the detail pages, &hellip; <a href=\"https:\/\/blog.get-map.org\/index.php\/2018\/12\/02\/some-basic-pdf-hyperlink-support\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Some basic PDF hyperlink support&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.get-map.org\/index.php\/wp-json\/wp\/v2\/posts\/330"}],"collection":[{"href":"https:\/\/blog.get-map.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.get-map.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.get-map.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.get-map.org\/index.php\/wp-json\/wp\/v2\/comments?post=330"}],"version-history":[{"count":2,"href":"https:\/\/blog.get-map.org\/index.php\/wp-json\/wp\/v2\/posts\/330\/revisions"}],"predecessor-version":[{"id":332,"href":"https:\/\/blog.get-map.org\/index.php\/wp-json\/wp\/v2\/posts\/330\/revisions\/332"}],"wp:attachment":[{"href":"https:\/\/blog.get-map.org\/index.php\/wp-json\/wp\/v2\/media?parent=330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.get-map.org\/index.php\/wp-json\/wp\/v2\/categories?post=330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.get-map.org\/index.php\/wp-json\/wp\/v2\/tags?post=330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}