Sha256: f42fc1e4a20e8aaded7935ef5ad1bb0fa000db9c487cb4d0d41a1cf321a75d02

Contents?: true

Size: 355 Bytes

Versions: 32

Compression:

Stored size: 355 Bytes

Contents

class HomeController < ApplicationController
  def index
  end

  def make_pdf
    doc = HexaPDF::Document.new
    canvas = doc.pages.add.canvas
    canvas.font('Helvetica', size: 40)
    name = Faker::Name.name
    canvas.text("Hello #{name}", at: [20, 400])
    doc.write("hello-jin.pdf")

    flash.notice = "PDF Created!"

    render :index
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
rails_app_generator-0.2.30 after_templates/addons/hexapdf/app/controllers/home_controller.rb
rails_app_generator-0.2.29 after_templates/addons/hexapdf/app/controllers/home_controller.rb
rails_app_generator-0.2.28 after_templates/addons/hexapdf/app/controllers/home_controller.rb
rails_app_generator-0.2.27 after_templates/addons/hexapdf/app/controllers/home_controller.rb
rails_app_generator-0.2.26 after_templates/addons/hexapdf/app/controllers/home_controller.rb
rails_app_generator-0.2.25 after_templates/addons/hexapdf/app/controllers/home_controller.rb
rails_app_generator-0.2.24 after_templates/addons/hexapdf/app/controllers/home_controller.rb
rails_app_generator-0.2.23 after_templates/addons/hexapdf/app/controllers/home_controller.rb
rails_app_generator-0.2.22 after_templates/addons/hexapdf/app/controllers/home_controller.rb
rails_app_generator-0.2.21 after_templates/addons/hexapdf/app/controllers/home_controller.rb
rails_app_generator-0.2.20 after_templates/addons/hexapdf/app/controllers/home_controller.rb
rails_app_generator-0.2.19 after_templates/addons/hexapdf/app/controllers/home_controller.rb