Class: HtmlConverter::Renderer::PDF

Inherits:
Base
  • Object
show all
Defined in:
lib/htmlconverter/renderer/pdf.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from HtmlConverter::Renderer::Base

Instance Method Details

#render(page) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/htmlconverter/renderer/pdf.rb', line 5

def render(page)
  printer = Qt::Printer.new(Qt::Printer::HighResolution)
  generate do |filename|
    printer.setOutputFileName(filename)
    printer.setOutputFormat(Qt::Printer::PdfFormat)
    page.mainFrame.print(printer)
  end
end