Sha256: 42e0951c080b1e1b11a6ae5143c7910a3b5f3a36aada2a5417bfd4498baf1141

Contents?: true

Size: 1.08 KB

Versions: 29

Compression:

Stored size: 1.08 KB

Contents

#--
# PDF::Writer for Ruby.
#   http://rubyforge.org/projects/ruby-pdf/
#   Copyright 2003 - 2005 Austin Ziegler.
#
#   Licensed under a MIT-style licence. See LICENCE in the main distribution
#   for full licensing information.
#
# $Id: destination.rb 50 2005-05-16 03:59:21Z austin $
#++
  # Destination object, used to specify the location for the user to jump
  # to; presently, only on opening.
class PDF::Writer::Object::Destination < PDF::Writer::Object
  def initialize(parent, page, type, *params)
    super(parent)

    case type
    when "FitR"
      raise TypeError if params.size < 4
      @string = "/#{type} #{params[0..3].join(' ')}"
    when "XYZ"
      params = (params + [ "null" ] * 4).first(4)
      @string = "/#{type} #{params[0..2].join(' ')}"
    when "FitH", "FitV", "FitBH", "FitBV"
      raise TypeError if params.empty?
      @string = "/#{type} #{params[0]}"
    when "Fit", "FitB"
      @string = "/#{type}"
    end

    @page = page
  end

  attr_accessor :string
  attr_accessor :page

  def to_s
    "\n#{@oid} 0 obj\n[#{@page.oid} 0 R #{@string}]\nendobj\n"
  end
end

Version data entries

29 entries across 29 versions & 4 rubygems

Version Path
rhodes-7.6.0 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-7.5.1 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-7.4.1 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-7.1.17 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-6.2.0 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-6.0.11 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-5.5.18 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-5.5.17 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-5.5.15 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-5.5.0.22 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-5.5.2 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-5.5.0.7 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-5.5.0.3 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-5.5.0 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
tauplatform-1.0.3 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
tauplatform-1.0.2 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
tauplatform-1.0.1 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-3.5.1.12 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-3.3.5 lib/extensions/pdf-writer/pdf/writer/object/destination.rb
rhodes-3.4.2 lib/extensions/pdf-writer/pdf/writer/object/destination.rb