Sha256: 6af76f804c00915bf2436c69ad3aa0a6a31fb05668f4527504fb979e39d191e5

Contents?: true

Size: 1.01 KB

Versions: 10

Compression:

Stored size: 1.01 KB

Contents

# encoding: utf-8

require_relative 'base'

require 'libis/format/tool/office_to_pdf'
require 'libis/format/type_database'

module Libis
  module Format
    module Converter

      class OfficeConverter < Libis::Format::Converter::Base

        def self.input_types
          [
              :TXT,
              :RTF,
              :HTML,
              :MSDOC,
              :MSDOT,
              :MSXLS,
              :MSPPT,
              :MSDOCX,
              :MSDOTX,
              :MSXLSX,
              :MSPPTX,
              :WORDPERFECT,
              :OO_WRITER,
              :OO_IMPRESS,
              :OO_CALC
          ]
        end

        def self.output_types(format = nil)
          return [] unless input_types.include?(format)
          [:PDF]
        end

        def office_convert(_)
          #force usage of this converter
        end

        def convert(source, target, format, opts = {})
          super

          Format::Tool::OfficeToPdf.run(source, target)

        end

      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
libis-format-1.2.9 lib/libis/format/converter/office_converter.rb
libis-format-1.2.8 lib/libis/format/converter/office_converter.rb
libis-format-1.2.7 lib/libis/format/converter/office_converter.rb
libis-format-1.2.6 lib/libis/format/converter/office_converter.rb
libis-format-1.2.5 lib/libis/format/converter/office_converter.rb
libis-format-1.2.3 lib/libis/format/converter/office_converter.rb
libis-format-1.2.2 lib/libis/format/converter/office_converter.rb
libis-format-1.2.1 lib/libis/format/converter/office_converter.rb
libis-format-1.2.0 lib/libis/format/converter/office_converter.rb
libis-format-1.1.0 lib/libis/format/converter/office_converter.rb