Sha256: a6bff0a270c62da75d9fb3a321575814f02a7cc3b74b4b21d0130b76ca830a52

Contents?: true

Size: 661 Bytes

Versions: 1

Compression:

Stored size: 661 Bytes

Contents

module Clamsy
  class CupsPdfPrinter < BasePrinter
    class << self

      private

        def doc_to_pdf(doc_path)
          system("#{config.ooffice_bin} #{config.ooffice_print_args} #{doc_path}")
          pdf_path = tmp_pdf_path(doc_path)
          file_must_exist!(pdf_path, 10) ; pdf_path
        end

        def tmp_pdf_path(doc_path)
          if output_file = config.cups_output_file
            output_file.is_a?(Proc) ? output_file.call : output_file
          else
            ext = doc_path.split('.').last
            File.join(config.cups_output_dir, File.basename(doc_path)).sub(/#{ext}$/, 'pdf')
          end
        end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
clamsy-0.0.5 lib/clamsy/cups_pdf_printer.rb