class PDF::Writer::TagIlink
A callback for creating and managing links internal to the document.
Public Class Methods
[](pdf, info)
click to toggle source
# File lib/pdf/writer.rb 2560 def self.[](pdf, info) 2561 case info[:status] 2562 when :start, :start_line 2563 @links ||= {} 2564 @links[info[:cbid]] = { 2565 :x => info[:x], 2566 :y => info[:y], 2567 :angle => info[:angle], 2568 :descender => info[:descender], 2569 :height => info[:height], 2570 :uri => info[:params]["dest"] 2571 } 2572 when :end, :end_line 2573 # The end of the link. Assume that it is the most recent opening 2574 # which has closed. 2575 start = @links[info[:cbid]] 2576 pdf.add_internal_link(start[:uri], start[:x], 2577 start[:y] + start[:descender], info[:x], 2578 start[:y] + start[:descender] + 2579 start[:height]) 2580 end 2581 end