PDF: switch TCPDF UTF-8 or FPDF ANSI (#61).
If server is Windows or language is CJK or Thai, Redmine uses FPDF. Else Redmine uses TCPDF. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5259 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
69bad84604
commit
098c1cb4fd
|
@ -37,7 +37,7 @@ module Redmine
|
||||||
super()
|
super()
|
||||||
set_language_if_valid lang
|
set_language_if_valid lang
|
||||||
@font_for_content = 'FreeSans'
|
@font_for_content = 'FreeSans'
|
||||||
@font_for_footer = 'FreeSans'
|
@font_for_footer = 'FreeSans'
|
||||||
SetCreator(Redmine::Info.app_name)
|
SetCreator(Redmine::Info.app_name)
|
||||||
SetFont(@font_for_content)
|
SetFont(@font_for_content)
|
||||||
end
|
end
|
||||||
|
@ -93,7 +93,7 @@ module Redmine
|
||||||
extend(PDF_Korean)
|
extend(PDF_Korean)
|
||||||
AddUHCFont()
|
AddUHCFont()
|
||||||
@font_for_content = 'UHC'
|
@font_for_content = 'UHC'
|
||||||
@font_for_footer = 'UHC'
|
@font_for_footer = 'UHC'
|
||||||
when 'ja'
|
when 'ja'
|
||||||
extend(PDF_Japanese)
|
extend(PDF_Japanese)
|
||||||
AddSJISFont()
|
AddSJISFont()
|
||||||
|
@ -111,7 +111,7 @@ module Redmine
|
||||||
@font_for_footer = 'Big5'
|
@font_for_footer = 'Big5'
|
||||||
else
|
else
|
||||||
@font_for_content = 'Arial'
|
@font_for_content = 'Arial'
|
||||||
@font_for_footer = 'Helvetica'
|
@font_for_footer = 'Helvetica'
|
||||||
end
|
end
|
||||||
SetCreator(Redmine::Info.app_name)
|
SetCreator(Redmine::Info.app_name)
|
||||||
SetFont(@font_for_content)
|
SetFont(@font_for_content)
|
||||||
|
@ -179,8 +179,16 @@ module Redmine
|
||||||
|
|
||||||
# Returns a PDF string of a list of issues
|
# Returns a PDF string of a list of issues
|
||||||
def issues_to_pdf(issues, project, query)
|
def issues_to_pdf(issues, project, query)
|
||||||
pdf = IFPDF.new(current_language)
|
if Redmine::Platform.mswin? ||
|
||||||
|
( current_language.to_s.downcase == 'ko' ||
|
||||||
|
current_language.to_s.downcase == 'ja' ||
|
||||||
|
current_language.to_s.downcase == 'zh' ||
|
||||||
|
current_language.to_s.downcase == 'zh-tw' ||
|
||||||
|
current_language.to_s.downcase == 'th' )
|
||||||
|
pdf = IFPDF.new(current_language)
|
||||||
|
else
|
||||||
|
pdf = ITCPDF.new(current_language)
|
||||||
|
end
|
||||||
title = query.new_record? ? l(:label_issue_plural) : query.name
|
title = query.new_record? ? l(:label_issue_plural) : query.name
|
||||||
title = "#{project} - #{title}" if project
|
title = "#{project} - #{title}" if project
|
||||||
pdf.SetTitle(title)
|
pdf.SetTitle(title)
|
||||||
|
@ -251,7 +259,16 @@ module Redmine
|
||||||
|
|
||||||
# Returns a PDF string of a single issue
|
# Returns a PDF string of a single issue
|
||||||
def issue_to_pdf(issue)
|
def issue_to_pdf(issue)
|
||||||
pdf = IFPDF.new(current_language)
|
if Redmine::Platform.mswin? ||
|
||||||
|
( current_language.to_s.downcase == 'ko' ||
|
||||||
|
current_language.to_s.downcase == 'ja' ||
|
||||||
|
current_language.to_s.downcase == 'zh' ||
|
||||||
|
current_language.to_s.downcase == 'zh-tw' ||
|
||||||
|
current_language.to_s.downcase == 'th' )
|
||||||
|
pdf = IFPDF.new(current_language)
|
||||||
|
else
|
||||||
|
pdf = ITCPDF.new(current_language)
|
||||||
|
end
|
||||||
pdf.SetTitle("#{issue.project} - ##{issue.tracker} #{issue.id}")
|
pdf.SetTitle("#{issue.project} - ##{issue.tracker} #{issue.id}")
|
||||||
pdf.alias_nb_pages
|
pdf.alias_nb_pages
|
||||||
pdf.footer_date = format_date(Date.today)
|
pdf.footer_date = format_date(Date.today)
|
||||||
|
|
|
@ -511,7 +511,16 @@ module Redmine
|
||||||
end if Object.const_defined?(:Magick)
|
end if Object.const_defined?(:Magick)
|
||||||
|
|
||||||
def to_pdf
|
def to_pdf
|
||||||
pdf = ::Redmine::Export::PDF::IFPDF.new(current_language)
|
if Redmine::Platform.mswin? ||
|
||||||
|
( current_language.to_s.downcase == 'ko' ||
|
||||||
|
current_language.to_s.downcase == 'ja' ||
|
||||||
|
current_language.to_s.downcase == 'zh' ||
|
||||||
|
current_language.to_s.downcase == 'zh-tw' ||
|
||||||
|
current_language.to_s.downcase == 'th' )
|
||||||
|
pdf = ::Redmine::Export::PDF::IFPDF.new(current_language)
|
||||||
|
else
|
||||||
|
pdf = ::Redmine::Export::PDF::ITCPDF.new(current_language)
|
||||||
|
end
|
||||||
pdf.SetTitle("#{l(:label_gantt)} #{project}")
|
pdf.SetTitle("#{l(:label_gantt)} #{project}")
|
||||||
pdf.alias_nb_pages
|
pdf.alias_nb_pages
|
||||||
pdf.footer_date = format_date(Date.today)
|
pdf.footer_date = format_date(Date.today)
|
||||||
|
|
Loading…
Reference in New Issue