PDF: code clean up lib/redmine/export/pdf.rb.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5296 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-04-03 02:47:06 +00:00 committed by Eric Davis
parent 73c5191196
commit 966a7a9c34
1 changed files with 6 additions and 6 deletions

View File

@ -132,7 +132,7 @@ module Redmine
end || '' end || ''
super(txt) super(txt)
end end
def textstring(s) def textstring(s)
# Format a text string # Format a text string
if s =~ /^</ # This means the string is hex-dumped. if s =~ /^</ # This means the string is hex-dumped.
@ -141,7 +141,7 @@ module Redmine
return '('+escape(s)+')' return '('+escape(s)+')'
end end
end end
def fix_text_encoding(txt) def fix_text_encoding(txt)
@ic ||= Iconv.new(l(:general_pdf_encoding), 'UTF-8') @ic ||= Iconv.new(l(:general_pdf_encoding), 'UTF-8')
# these quotation marks are not correctly rendered in the pdf # these quotation marks are not correctly rendered in the pdf
@ -154,17 +154,17 @@ module Redmine
rescue rescue
txt txt
end || '' end || ''
return txt return txt
end end
def RDMCell(w,h=0,txt='',border=0,ln=0,align='',fill=0,link='') def RDMCell(w,h=0,txt='',border=0,ln=0,align='',fill=0,link='')
Cell(w,h,fix_text_encoding(txt),border,ln,align,fill,link) Cell(w,h,fix_text_encoding(txt),border,ln,align,fill,link)
end end
def RDMMultiCell(w,h=0,txt='',border=0,align='',fill=0) def RDMMultiCell(w,h=0,txt='',border=0,align='',fill=0)
MultiCell(w,h,fix_text_encoding(txt),border,align,fill) MultiCell(w,h,fix_text_encoding(txt),border,align,fill)
end end
def Footer def Footer
SetFont(@font_for_footer, 'I', 8) SetFont(@font_for_footer, 'I', 8)
SetY(-15) SetY(-15)