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