Defect #61 » 61.patch
| lib/redmine/export/pdf.rb (working copy) | ||
|---|---|---|
|
require 'iconv'
|
||
|
require 'rfpdf/fpdf'
|
||
|
require 'rfpdf/chinese'
|
||
|
#require 'rfpdf/chinese'
|
||
|
module Redmine
|
||
|
module Export
|
||
| ... | ... | |
|
include ActionView::Helpers::TextHelper
|
||
|
include ActionView::Helpers::NumberHelper
|
||
|
|
||
|
class IFPDF < FPDF
|
||
|
class IFPDF < TCPDF
|
||
|
include Redmine::I18n
|
||
|
attr_accessor :footer_date
|
||
|
|
||
| ... | ... | |
|
@font_for_content = 'Big5'
|
||
|
@font_for_footer = 'Big5'
|
||
|
else
|
||
|
@font_for_content = 'Arial'
|
||
|
@font_for_footer = 'Helvetica'
|
||
|
@font_for_content = 'FreeSans'
|
||
|
@font_for_footer = 'FreeSans'
|
||
|
end
|
||
|
SetCreator(Redmine::Info.app_name)
|
||
|
SetFont(@font_for_content)
|
||
| ... | ... | |
|
title = query.new_record? ? l(:label_issue_plural) : query.name
|
||
|
title = "#{project} - #{title}" if project
|
||
|
pdf.SetTitle(title)
|
||
|
pdf.AliasNbPages
|
||
|
pdf.alias_nb_pages
|
||
|
pdf.footer_date = format_date(Date.today)
|
||
|
pdf.AddPage("L")
|
||
|
|
||
| ... | ... | |
|
def issue_to_pdf(issue)
|
||
|
pdf = IFPDF.new(current_language)
|
||
|
pdf.SetTitle("#{issue.project} - ##{issue.tracker} #{issue.id}")
|
||
|
pdf.AliasNbPages
|
||
|
pdf.alias_nb_pages
|
||
|
pdf.footer_date = format_date(Date.today)
|
||
|
pdf.AddPage
|
||
|
|
||
| ... | ... | |
|
def gantt_to_pdf(gantt, project)
|
||
|
pdf = IFPDF.new(current_language)
|
||
|
pdf.SetTitle("#{l(:label_gantt)} #{project}")
|
||
|
pdf.AliasNbPages
|
||
|
pdf.alias_nb_pages
|
||
|
pdf.footer_date = format_date(Date.today)
|
||
|
pdf.AddPage("L")
|
||
|
pdf.SetFontStyle('B',12)
|
||