Sha256: 77fe7063876788ef68140f2428e05cbdbe7a7fce24278a1dd41b2c9b84303f38

Contents?: true

Size: 422 Bytes

Versions: 14

Compression:

Stored size: 422 Bytes

Contents

class LatexExampleController < ApplicationController
  def index
  end

  def barcode
    render :layout => 'barcode', formats: [:pdf]
  end

  def barcode_as_string
    @pdf=render_to_string(action: 'barcode', layout: "barcode", formats: [:pdf])
    self.content_type = 'text/html'

    File.open(file="#{Rails.root}/tmp/a.pdf",'w:binary') do |io|
      io.write(@pdf)
    end

    render text: "wrote #{file}"
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rails-latex-2.3.4 examples/rails-latex-demo/app/controllers/latex_example_controller.rb
rails-latex-2.3.3 examples/rails-latex-demo/app/controllers/latex_example_controller.rb
rails-latex-2.3.2 examples/rails-latex-demo/app/controllers/latex_example_controller.rb
rails-latex-2.3.0 examples/rails-latex-demo/app/controllers/latex_example_controller.rb
rails-latex-2.2.2 examples/rails-latex-demo/app/controllers/latex_example_controller.rb
rails-latex-2.2.1 examples/rails-latex-demo/app/controllers/latex_example_controller.rb
rails-latex-2.2.0 examples/rails-latex-demo/app/controllers/latex_example_controller.rb
rails-latex-2.1.0 examples/rails-latex-demo/app/controllers/latex_example_controller.rb
rails-latex-2.0.1 examples/rails-latex-demo/app/controllers/latex_example_controller.rb
rails-latex-2.0.0 examples/rails-latex-demo/app/controllers/latex_example_controller.rb
rails-latex-1.0.14 examples/rails-latex-demo/app/controllers/latex_example_controller.rb
rails-latex-1.0.13 examples/rails-latex-demo/app/controllers/latex_example_controller.rb
rails-latex-1.0.12 examples/rails-latex-demo/app/controllers/latex_example_controller.rb
rails-latex-1.0.11 examples/rails-latex-demo/app/controllers/latex_example_controller.rb