Class: CodeSlide::PNGFormatter
- Inherits:
-
Object
- Object
- CodeSlide::PNGFormatter
- Defined in:
- lib/code_slide/png_formatter.rb
Instance Method Summary collapse
- #generate_png(filename, dpi: 300, keep_pdf: false) ⇒ Object
-
#initialize(pdf_filename) ⇒ PNGFormatter
constructor
A new instance of PNGFormatter.
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 |