| Class | PDF::Writer::TagIlink |
| In: |
lib/pdf/writer.rb
|
| Parent: | Object |
A callback for creating and managing links internal to the document.
# File lib/pdf/writer.rb, line 2578
2578: def self.[](pdf, info)
2579: case info[:status]
2580: when :start, :start_line
2581: @links ||= {}
2582: @links[info[:cbid]] = {
2583: :x => info[:x],
2584: :y => info[:y],
2585: :angle => info[:angle],
2586: :descender => info[:descender],
2587: :height => info[:height],
2588: :uri => info[:params]["dest"]
2589: }
2590: when :end, :end_line
2591: # The end of the link. Assume that it is the most recent opening
2592: # which has closed.
2593: start = @links[info[:cbid]]
2594: pdf.add_internal_link(start[:uri], start[:x],
2595: start[:y] + start[:descender], info[:x],
2596: start[:y] + start[:descender] +
2597: start[:height])
2598: end
2599: end