{"id":434,"date":"2013-05-23T00:33:03","date_gmt":"2013-05-23T06:33:03","guid":{"rendered":"http:\/\/rrbits.com\/epb\/?p=434"},"modified":"2013-05-23T00:34:16","modified_gmt":"2013-05-23T06:34:16","slug":"anchor-links-in-tcpdf","status":"publish","type":"post","link":"https:\/\/rrbits.com\/epb\/2013\/05\/23\/anchor-links-in-tcpdf\/","title":{"rendered":"Anchor links in TCPDF"},"content":{"rendered":"<p>A question was posed on StackOverflow regarding html anchor links like &#8216;#test&#8217;, and how you might go about preserving them.\u00a0 However, it got deleted before I could post my answer.\u00a0 This is current as of today, May 22, 2013.<\/p>\n<p>If you are using a version of TCPDF less than 5.9.193, links that start with `#` need to be changed to reference a page number and, optionally, Y position.\u00a0 For example, `<code>#3,4.5<\/code>` to jump to page 3 at position 4.5.<\/p>\n<p>As of 5.9.193, you can link to named destinations with html links this way.\u00a0 However, for this to work, you need to add the named destination yourself with the `<code>setDestination<\/code>` method. <sup>[1]<\/sup> So with the example of `<code>#test<\/code>` you&#8217;ll need to have created a named destination called `<code>test<\/code>` with `<code>setDestination<\/code>`.<\/p>\n<p>For an example of how this might be used, see the feature request that got it added: <a href=\"http:\/\/sourceforge.net\/p\/tcpdf\/feature-requests\/265\/\">Feature request #265 HTML href link to destination or bookmark<\/a><\/p>\n<p>[1.] As far as I&#8217;ve experienced, these do not seem to work in Firefox&#8217;s current PDF.js reader however.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A question was posed on StackOverflow regarding html anchor links like &#8216;#test&#8217;, and how you might go about preserving them.\u00a0 However, it got deleted before I could post my answer.\u00a0 This is current as of today, May 22, 2013. If you are using a version of TCPDF less than 5.9.193, links that start with `#`&#8230;  <a class=\"excerpt-read-more\" href=\"https:\/\/rrbits.com\/epb\/2013\/05\/23\/anchor-links-in-tcpdf\/\" title=\"ReadAnchor links in TCPDF\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[178,3999],"tags":[4244],"class_list":["post-434","post","type-post","status-publish","format-standard","hentry","category-problems","category-programming","tag-tcpdf"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/posts\/434","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/comments?post=434"}],"version-history":[{"count":3,"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/posts\/434\/revisions"}],"predecessor-version":[{"id":437,"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/posts\/434\/revisions\/437"}],"wp:attachment":[{"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/media?parent=434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/categories?post=434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rrbits.com\/epb\/wp-json\/wp\/v2\/tags?post=434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}