##// END OF EJS Templates
Creator property added for generated pdf files...
Jean-Philippe Lang -
r221:a3c2c4a48af6
parent child
Show More
@@ -1,48 +1,53
1 1 # redMine - project management software
2 2 # Copyright (C) 2006 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 require 'iconv'
19 19
20 20 module IfpdfHelper
21 21
22 22 class IFPDF < FPDF
23 23
24 24 attr_accessor :footer_date
25 25
26 def initialize
27 super
28 SetCreator("redMine #{Redmine::VERSION}")
29 end
30
26 31 def Cell(w,h=0,txt='',border=0,ln=0,align='',fill=0,link='')
27 32 @ic ||= Iconv.new('ISO-8859-1', 'UTF-8')
28 33 txt = begin
29 34 @ic.iconv(txt)
30 35 rescue
31 36 txt
32 37 end
33 38 super w,h,txt,border,ln,align,fill,link
34 39 end
35 40
36 41 def Footer
37 42 SetFont('Helvetica', 'I', 8)
38 43 SetY(-15)
39 44 SetX(15)
40 45 Cell(0, 5, @footer_date, 0, 0, 'L')
41 46 SetY(-15)
42 47 SetX(-30)
43 48 Cell(0, 5, PageNo().to_s + '/{nb}', 0, 0, 'C')
44 49 end
45 50
46 51 end
47 52
48 53 end
General Comments 0
You need to be logged in to leave comments. Login now