##// END OF EJS Templates
Email notifications are now sent as Blind carbon copy by default. This can be changed in email notifications settings (new setting added)....
Email notifications are now sent as Blind carbon copy by default. This can be changed in email notifications settings (new setting added). Emission email address setting moved to the email notifications settings view. git-svn-id: http://redmine.rubyforge.org/svn/trunk@944 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r858:d9e6359a839d
r931:bc060b31ae08
Show More
ifpdf_helper.rb
80 lines | 2.3 KiB | text/x-ruby | RubyLexer
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 # redMine - project management software
# Copyright (C) 2006 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'iconv'
require 'rfpdf/chinese'
module IfpdfHelper
class IFPDF < FPDF
include GLoc
attr_accessor :footer_date
def initialize(lang)
super()
set_language_if_valid lang
case current_language
when :ja
extend(PDF_Japanese)
AddSJISFont()
@font_for_content = 'SJIS'
@font_for_footer = 'SJIS'
Jean-Philippe Lang
Added chinese simplified translation (Andy Wu)...
r390 when :zh
extend(PDF_Chinese)
AddBig5Font()
@font_for_content = 'Big5'
@font_for_footer = 'Big5'
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 else
@font_for_content = 'Arial'
@font_for_footer = 'Helvetica'
end
SetCreator("redMine #{Redmine::VERSION}")
SetFont(@font_for_content)
end
def SetFontStyle(style, size)
SetFont(@font_for_content, style, size)
end
def Cell(w,h=0,txt='',border=0,ln=0,align='',fill=0,link='')
@ic ||= Iconv.new(l(:general_pdf_encoding), 'UTF-8')
Jean-Philippe Lang
Fixed: some quotation marks are rendered as strange characters in pdf....
r858 # these quotation marks are not correctly rendered in the pdf
txt = txt.gsub(/[“”]/, '"') if txt
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 txt = begin
Jean-Philippe Lang
Fixed: improper 0x5c char handling in PDF output (Go Maeda)....
r802 # 0x5c char handling
txtar = txt.split('\\')
txtar << '' if txt[-1] == ?\\
txtar.collect {|x| @ic.iconv(x)}.join('\\').gsub(/\\/, "\\\\\\\\")
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 rescue
txt
Jean-Philippe Lang
Fixed: improper 0x5c char handling in PDF output (Go Maeda)....
r802 end || ''
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 super w,h,txt,border,ln,align,fill,link
end
def Footer
SetFont(@font_for_footer, 'I', 8)
SetY(-15)
SetX(15)
Cell(0, 5, @footer_date, 0, 0, 'L')
SetY(-15)
SetX(-30)
Cell(0, 5, PageNo().to_s + '/{nb}', 0, 0, 'C')
end
Jean-Philippe Lang
* single/multiple issues pdf export added...
r35 end
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330
end