Showing
3 changed files
with
1 additions
and
43 deletions
| ... | ... | @@ -30,29 +30,8 @@ module Kanjai |
| 30 | 30 | layer = @page_data.page.page_template.get_html_content |
| 31 | 31 | content_for_render = setTemplateContent(@page_data.page.page_template, layer, @page_data) |
| 32 | 32 | |
| 33 | - @pdf_content = content_for_render | |
| 34 | 33 | respond_to do |format| |
| 35 | 34 | format.html{render :plain => content_for_render} |
| 36 | - format.pdf{ | |
| 37 | - options = { | |
| 38 | - pdf: "file_name", | |
| 39 | - print_media_type: true, | |
| 40 | - orientation: params[:orientation], | |
| 41 | - page_size: params[:page_size] || 'A4' | |
| 42 | - } | |
| 43 | - | |
| 44 | - if params['header_content'] | |
| 45 | - options[:header] ||= {} | |
| 46 | - options[:header][:content] = params['header_content'] | |
| 47 | - end | |
| 48 | - | |
| 49 | - if params['footer_content'] | |
| 50 | - options[:footer] ||= {} | |
| 51 | - options[:footer][:content] = params['footer_content'] | |
| 52 | - end | |
| 53 | - | |
| 54 | - render options | |
| 55 | - } | |
| 56 | 35 | end |
| 57 | 36 | |
| 58 | 37 | #render :text => content_for_render and return | ... | ... |
config/initializers/wicked_pdf.rb
deleted
100644 → 0
| 1 | -# WickedPDF Global Configuration | |
| 2 | -# | |
| 3 | -# Use this to set up shared configuration options for your entire application. | |
| 4 | -# Any of the configuration options shown here can also be applied to single | |
| 5 | -# models by passing arguments to the `render :pdf` call. | |
| 6 | -# | |
| 7 | -# To learn more, check out the README: | |
| 8 | -# | |
| 9 | -# https://github.com/mileszs/wicked_pdf/blob/master/README.md | |
| 10 | - | |
| 11 | -WickedPdf.config = { | |
| 12 | - # Path to the wkhtmltopdf executable: This usually isn't needed if using | |
| 13 | - # one of the wkhtmltopdf-binary family of gems. | |
| 14 | - # exe_path: '/usr/local/bin/wkhtmltopdf', | |
| 15 | - # or | |
| 16 | - # exe_path: Gem.bin_path('wkhtmltopdf-binary', 'wkhtmltopdf') | |
| 17 | - | |
| 18 | - # Layout file to be used for all PDFs | |
| 19 | - # (but can be overridden in `render :pdf` calls) | |
| 20 | - #layout: 'pdf.html', | |
| 21 | -} |