Class: DerivativeRodeo::Services::PdfSplitter::PngPage

Inherits:
Base
  • Object
show all
Defined in:
lib/derivative_rodeo/services/pdf_splitter/png_page.rb

Overview

The purpose of this class is to split the PDF into constituent png files.

Instance Attribute Summary

Attributes inherited from Base

#ghost_script_output_file_template

Instance Method Summary collapse

Methods inherited from Base

#each, #initialize, #invalid_pdf?

Constructor Details

This class inherits a constructor from DerivativeRodeo::Services::PdfSplitter::Base

Instance Method Details

#gsdeviceObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/derivative_rodeo/services/pdf_splitter/png_page.rb', line 10

def gsdevice
  return @gsdevice if defined?(@gsdevice)

  color = pdf_pages_summary.color_description
  bits_per_channel = pdf_pages_summary.bits_per_channel
  if color == 'gray'
    # 1 Bit Grayscale, if applicable:
    return @gsdevice = 'pngmonod' if bits_per_channel == 1
    return @gsdevice = 'pnggray' if bits_per_channel > 1
  end

  @gsdevice = 'png16m'
end