RE: Export to PDF works strange with russian symbols ยป pdf.rb.patch
pdf.rb 2009-05-20 01:47:01.000000000 +0300 | ||
---|---|---|
16 | 16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | 17 | |
18 | 18 |
require 'iconv' |
19 |
require 'rfpdf/fpdf'
|
|
20 |
require 'rfpdf/chinese' |
|
19 |
require 'tcpdf'
|
|
20 |
#require 'rfpdf/chinese'
|
|
21 | 21 | |
22 | 22 |
module Redmine |
23 | 23 |
module Export |
... | ... | |
25 | 25 |
include ActionView::Helpers::TextHelper |
26 | 26 |
include ActionView::Helpers::NumberHelper |
27 | 27 |
|
28 |
class IFPDF < FPDF
|
|
28 |
class IFPDF < TCPDF
|
|
29 | 29 |
include Redmine::I18n |
30 | 30 |
attr_accessor :footer_date |
31 | 31 |
|
... | ... | |
49 | 49 |
@font_for_content = 'Big5' |
50 | 50 |
@font_for_footer = 'Big5' |
51 | 51 |
else |
52 |
@font_for_content = 'Arial'
|
|
53 |
@font_for_footer = 'Helvetica'
|
|
52 |
@font_for_content = 'FreeSans'
|
|
53 |
@font_for_footer = 'FreeSans'
|
|
54 | 54 |
end |
55 | 55 |
SetCreator(Redmine::Info.app_name) |
56 | 56 |
SetFont(@font_for_content) |
... | ... | |
112 | 112 |
pdf = IFPDF.new(current_language) |
113 | 113 |
title = project ? "#{project} - #{l(:label_issue_plural)}" : "#{l(:label_issue_plural)}" |
114 | 114 |
pdf.SetTitle(title) |
115 |
pdf.AliasNbPages
|
|
115 |
pdf.alias_nb_pages
|
|
116 | 116 |
pdf.footer_date = format_date(Date.today) |
117 | 117 |
pdf.AddPage("L") |
118 | 118 |
row_height = 7 |
... | ... | |
169 | 169 |
def issue_to_pdf(issue) |
170 | 170 |
pdf = IFPDF.new(current_language) |
171 | 171 |
pdf.SetTitle("#{issue.project} - ##{issue.tracker} #{issue.id}") |
172 |
pdf.AliasNbPages
|
|
172 |
pdf.alias_nb_pages
|
|
173 | 173 |
pdf.footer_date = format_date(Date.today) |
174 | 174 |
pdf.AddPage |
175 | 175 |
|
... | ... | |
296 | 296 |
def gantt_to_pdf(gantt, project) |
297 | 297 |
pdf = IFPDF.new(current_language) |
298 | 298 |
pdf.SetTitle("#{l(:label_gantt)} #{project}") |
299 |
pdf.AliasNbPages
|
|
299 |
pdf.alias_nb_pages
|
|
300 | 300 |
pdf.footer_date = format_date(Date.today) |
301 | 301 |
pdf.AddPage("L") |
302 | 302 |
pdf.SetFontStyle('B',12) |