Commit 098c1cb4 authored by Toshi MARUYAMA's avatar Toshi MARUYAMA Committed by Eric Davis

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
parent 69bad846
......@@ -179,8 +179,16 @@ module Redmine
# Returns a PDF string of a list of issues
def issues_to_pdf(issues, project, query)
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 = "#{project} - #{title}" if project
pdf.SetTitle(title)
......@@ -251,7 +259,16 @@ module Redmine
# Returns a PDF string of a single issue
def issue_to_pdf(issue)
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.alias_nb_pages
pdf.footer_date = format_date(Date.today)
......
......@@ -511,7 +511,16 @@ module Redmine
end if Object.const_defined?(:Magick)
def to_pdf
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.alias_nb_pages
pdf.footer_date = format_date(Date.today)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment