Defect #61 » 61.patch
lib/redmine/export/pdf.rb (working copy) | ||
---|---|---|
19 | 19 | |
20 | 20 |
require 'iconv' |
21 | 21 |
require 'rfpdf/fpdf' |
22 |
require 'rfpdf/chinese' |
|
22 |
#require 'rfpdf/chinese'
|
|
23 | 23 | |
24 | 24 |
module Redmine |
25 | 25 |
module Export |
... | ... | |
27 | 27 |
include ActionView::Helpers::TextHelper |
28 | 28 |
include ActionView::Helpers::NumberHelper |
29 | 29 |
|
30 |
class IFPDF < FPDF
|
|
30 |
class IFPDF < TCPDF
|
|
31 | 31 |
include Redmine::I18n |
32 | 32 |
attr_accessor :footer_date |
33 | 33 |
|
... | ... | |
56 | 56 |
@font_for_content = 'Big5' |
57 | 57 |
@font_for_footer = 'Big5' |
58 | 58 |
else |
59 |
@font_for_content = 'Arial'
|
|
60 |
@font_for_footer = 'Helvetica'
|
|
59 |
@font_for_content = 'FreeSans'
|
|
60 |
@font_for_footer = 'FreeSans'
|
|
61 | 61 |
end |
62 | 62 |
SetCreator(Redmine::Info.app_name) |
63 | 63 |
SetFont(@font_for_content) |
... | ... | |
120 | 120 |
title = query.new_record? ? l(:label_issue_plural) : query.name |
121 | 121 |
title = "#{project} - #{title}" if project |
122 | 122 |
pdf.SetTitle(title) |
123 |
pdf.AliasNbPages
|
|
123 |
pdf.alias_nb_pages
|
|
124 | 124 |
pdf.footer_date = format_date(Date.today) |
125 | 125 |
pdf.AddPage("L") |
126 | 126 |
|
... | ... | |
189 | 189 |
def issue_to_pdf(issue) |
190 | 190 |
pdf = IFPDF.new(current_language) |
191 | 191 |
pdf.SetTitle("#{issue.project} - ##{issue.tracker} #{issue.id}") |
192 |
pdf.AliasNbPages
|
|
192 |
pdf.alias_nb_pages
|
|
193 | 193 |
pdf.footer_date = format_date(Date.today) |
194 | 194 |
pdf.AddPage |
195 | 195 |
|
... | ... | |
316 | 316 |
def gantt_to_pdf(gantt, project) |
317 | 317 |
pdf = IFPDF.new(current_language) |
318 | 318 |
pdf.SetTitle("#{l(:label_gantt)} #{project}") |
319 |
pdf.AliasNbPages
|
|
319 |
pdf.alias_nb_pages
|
|
320 | 320 |
pdf.footer_date = format_date(Date.today) |
321 | 321 |
pdf.AddPage("L") |
322 | 322 |
pdf.SetFontStyle('B',12) |