Sha256: 3c525f47cf70ef6db0441bd1b18b85d8477d3cf7d994f3e4f895db1f52323621

Contents?: true

Size: 749 Bytes

Versions: 6

Compression:

Stored size: 749 Bytes

Contents

require 'os'

require 'libis/tools/extend/string'
require 'libis/tools/logger'
require 'libis/tools/command'

require 'libis/format/config'

module Libis
  module Format
    module Tool

      class PdfOptimizer
        include ::Libis::Tools::Logger

        def self.run(source, target, quality)
          self.new.run source, target, quality
        end

        def run(source, target, quality)

          Libis::Tools::Command.run(
              'gs',
              '-sDEVICE=pdfwrite',
              '-dCompatibilityLevel=1.4',
              "-dPDFSETTINGS=/#{quality}",
              '-dNOPAUSE',
              '-dBATCH',
              "-sOutputFile=#{target}",
              "#{source}"
          )

        end
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
libis-format-0.9.49 lib/libis/format/tool/pdf_optimizer.rb
libis-format-0.9.48 lib/libis/format/tool/pdf_optimizer.rb
libis-format-0.9.47 lib/libis/format/tool/pdf_optimizer.rb
libis-format-0.9.46 lib/libis/format/tool/pdf_optimizer.rb
libis-format-0.9.45 lib/libis/format/tool/pdf_optimizer.rb
libis-format-0.9.44 lib/libis/format/tool/pdf_optimizer.rb