Sha256: e23b35ac14298b3d43681f6d8d15e0e267517910fc909849b199a9cd14273ac6

Contents?: true

Size: 1.04 KB

Versions: 9

Compression:

Stored size: 1.04 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

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

          target

        end

      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
libis-format-1.0.8 lib/libis/format/converter/office_converter.rb
libis-format-1.0.7 lib/libis/format/converter/office_converter.rb
libis-format-1.0.5 lib/libis/format/converter/office_converter.rb
libis-format-1.0.4 lib/libis/format/converter/office_converter.rb
libis-format-1.0.2 lib/libis/format/converter/office_converter.rb
libis-format-1.0.1 lib/libis/format/converter/office_converter.rb
libis-format-1.0.0 lib/libis/format/converter/office_converter.rb
libis-format-0.9.74 lib/libis/format/converter/office_converter.rb
libis-format-0.9.72 lib/libis/format/converter/office_converter.rb