Sha256: 4e93b9a750c292e300caa3e0194c7dbba4e4850d3cdadee836e22462e004190c

Contents?: true

Size: 993 Bytes

Versions: 7

Compression:

Stored size: 993 Bytes

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,
          ]
        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

          return nil unless Format::Tool::OfficeToPdf.run(source, target)

          target

        end

      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
libis-format-0.9.70 lib/libis/format/converter/office_converter.rb
libis-format-0.9.69 lib/libis/format/converter/office_converter.rb
libis-format-0.9.68 lib/libis/format/converter/office_converter.rb
libis-format-0.9.67 lib/libis/format/converter/office_converter.rb
libis-format-0.9.66 lib/libis/format/converter/office_converter.rb
libis-format-0.9.65 lib/libis/format/converter/office_converter.rb
libis-format-0.9.64 lib/libis/format/converter/office_converter.rb