| 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 2549
2549: def self.[](pdf, info)
2550: case info[:status]
2551: when :start, :start_line
2552: @links ||= {}
2553: @links[info[:cbid]] = {
2554: :x => info[:x],
2555: :y => info[:y],
2556: :angle => info[:angle],
2557: :descender => info[:descender],
2558: :height => info[:height],
2559: :uri => info[:params]["dest"]
2560: }
2561: when :end, :end_line
2562: # The end of the link. Assume that it is the most recent opening
2563: # which has closed.
2564: start = @links[info[:cbid]]
2565: pdf.add_internal_link(start[:uri], start[:x],
2566: start[:y] + start[:descender], info[:x],
2567: start[:y] + start[:descender] +
2568: start[:height])
2569: end
2570: end