Class: CodeSlide::PNGFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/code_slide/png_formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(pdf_filename) ⇒ PNGFormatter

Returns a new instance of PNGFormatter.



3
4
5
# File 'lib/code_slide/png_formatter.rb', line 3

def initialize(pdf_filename)
  @pdf_filename = pdf_filename
end

Instance Method Details

#generate_png(filename, dpi: 300, keep_pdf: false) ⇒ Object



7
8
9
10
# File 'lib/code_slide/png_formatter.rb', line 7

def generate_png(filename, dpi: 300, keep_pdf: false)
  system 'gs -q -sDEVICE=png16m -dTextAlphaBits=4 ' \
         "-r#{dpi} -o #{filename} #{@pdf_filename}"
end