Sha256: ff10575417f5b5b2b3f3c0973f2218fb926560d1107b564d4d7fb88655f8c6e1

Contents?: true

Size: 1.71 KB

Versions: 7

Compression:

Stored size: 1.71 KB

Contents

=begin

    This file is part of Origami, PDF manipulation framework for Ruby
    Copyright (C) 2016	Guillaume Delugré.

    Origami is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Origami is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with Origami.  If not, see <http://www.gnu.org/licenses/>.

=end

require 'origami/parser'

module Origami

    class FDF
        class Parser < Origami::Parser
            def parse(stream) #:nodoc:
                super(stream)

                fdf = FDF.new(self)
                fdf.header = FDF::Header.parse(@data)
                @options[:callback].call(fdf.header)

                loop do
                    break if (object = parse_object).nil?
                    fdf.insert(object)
                end

                fdf.revisions.first.xreftable = parse_xreftable
                fdf.revisions.first.trailer = parse_trailer

                if Origami::OPTIONS[:enable_type_propagation]
                    trailer = fdf.revisions.first.trailer

                    if trailer[:Root].is_a?(Reference)
                        fdf.cast_object(trailer[:Root], FDF::Catalog)
                    end

                    propagate_types(fdf)
                end

                fdf
            end
        end
    end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
origamindee-3.1.0 lib/origami/parsers/fdf.rb
origamindee-3.0.0 lib/origami/parsers/fdf.rb
origami-2.1.0 lib/origami/parsers/fdf.rb
origami-2.0.4 lib/origami/parsers/fdf.rb
origami-2.0.3 lib/origami/parsers/fdf.rb
origami-2.0.2 lib/origami/parsers/fdf.rb
origami-2.0.1 lib/origami/parsers/fdf.rb