# Returns a PDF string of a list of issues
def issues_to_pdf(issues, project, query)
- if l(:general_pdf_encoding).upcase != 'UTF-8'
- pdf = IFPDF.new(current_language)
- else
- pdf = ITCPDF.new(current_language)
- end
+ pdf = ITCPDF.new(current_language)
title = query.new_record? ? l(:label_issue_plural) : query.name
title = "#{project} - #{title}" if project
pdf.SetTitle(title)
# Returns a PDF string of a single issue
def issue_to_pdf(issue)
- if l(:general_pdf_encoding).upcase != 'UTF-8'
- pdf = IFPDF.new(current_language)
- else
- pdf = ITCPDF.new(current_language)
- end
+ pdf = ITCPDF.new(current_language)
pdf.SetTitle("#{issue.project} - ##{issue.tracker} #{issue.id}")
pdf.alias_nb_pages
pdf.footer_date = format_date(Date.today)
end if Object.const_defined?(:Magick)
def to_pdf
- if l(:general_pdf_encoding).upcase != 'UTF-8'
- pdf = ::Redmine::Export::PDF::IFPDF.new(current_language)
- else
- pdf = ::Redmine::Export::PDF::ITCPDF.new(current_language)
- end
+ pdf = ::Redmine::Export::PDF::ITCPDF.new(current_language)
pdf.SetTitle("#{l(:label_gantt)} #{project}")
pdf.alias_nb_pages
pdf.footer_date = format_date(Date.today)
end
def GetStringWidth(s)
- if(@CurrentFont['type']=='Type0')
+ if(@current_font['type']=='Type0')
return GetMBStringWidth(s)
else
return super(s)
def GetMBStringWidth(s)
#Multi-byte version of GetStringWidth()
l=0
- cw=@CurrentFont['cw']
+ cw=@current_font['cw']
nb=s.length
i=0
while(i<nb)
i+=2
end
end
- return l*@FontSize/1000
+ return l*@font_size/1000
end
def MultiCell(w,h,txt,border=0,align='L',fill=0)
- if(@CurrentFont['type']=='Type0')
+ if(@current_font['type']=='Type0')
MBMultiCell(w,h,txt,border,align,fill)
else
super(w,h,txt,border,align,fill)
def MBMultiCell(w,h,txt,border=0,align='L',fill=0)
#Multi-byte version of MultiCell()
- cw=@CurrentFont['cw']
+ cw=@current_font['cw']
if(w==0)
- w=@w-@rMargin-@x
+ w=@w-@r_margin-@x
end
- wmax=(w-2*@cMargin)*1000/@FontSize
+ wmax=(w-2*@c_margin)*1000/@font_size
s=txt.gsub("\r",'')
nb=s.length
if(nb>0 and s[nb-1]=="\n")
b+='B'
end
Cell(w,h,s[j,i-j],b,2,align,fill)
- @x=@lMargin
+ @x=@l_margin
end
def Write(h,txt,link='')
- if(@CurrentFont['type']=='Type0')
+ if(@current_font['type']=='Type0')
MBWrite(h,txt,link)
else
super(h,txt,link)
def MBWrite(h,txt,link)
#Multi-byte version of Write()
- cw=@CurrentFont['cw']
- w=@w-@rMargin-@x
- wmax=(w-2*@cMargin)*1000/@FontSize
+ cw=@current_font['cw']
+ w=@w-@r_margin-@x
+ wmax=(w-2*@c_margin)*1000/@font_size
s=txt.gsub("\r",'')
nb=s.length
sep=-1
j=i
l=0
if(nl==1)
- @x=@lMargin
- w=@w-@rMargin-@x
- wmax=(w-2*@cMargin)*1000/@FontSize
+ @x=@l_margin
+ w=@w-@r_margin-@x
+ wmax=(w-2*@c_margin)*1000/@font_size
end
nl+=1
next
if(l>wmax)
#Automatic line break
if(sep==-1 or i==j)
- if(@x>@lMargin)
+ if(@x>@l_margin)
#Move to next line
- @x=@lMargin
+ @x=@l_margin
@y+=h
- w=@w-@rMargin-@x
- wmax=(w-2*@cMargin)*1000/@FontSize
+ w=@w-@r_margin-@x
+ wmax=(w-2*@c_margin)*1000/@font_size
i+=1
nl+=1
next
j=i
l=0
if(nl==1)
- @x=@lMargin
- w=@w-@rMargin-@x
- wmax=(w-2*@cMargin)*1000/@FontSize
+ @x=@l_margin
+ w=@w-@r_margin-@x
+ wmax=(w-2*@c_margin)*1000/@font_size
end
nl+=1
else
end
#Last chunk
if(i!=j)
- Cell(l/1000*@FontSize,h,s[j,i-j],0,0,'',0,link)
+ Cell(l/1000*@font_size,h,s[j,i-j],0,0,'',0,link)
end
end
end
# mqr=get_magic_quotes_runtime()
# set_magic_quotes_runtime(0)
- @FontFiles.each_pair do |file, info|
+ @font_files.each_pair do |file, info|
#Font file embedding
newobj()
- @FontFiles[file]['n']=@n
+ @font_files[file]['n']=@n
if(defined('FPDF_FONTPATH'))
file=FPDF_FONTPATH+file
end
end
file=font['file']
if(file)
- s+=' /FontFile'+(font['type']=='Type1' ? '' : '2')+' '+@FontFiles[file]['n']+' 0 R'
+ s+=' /FontFile'+(font['type']=='Type1' ? '' : '2')+' '+@font_files[file]['n']+' 0 R'
end
out(s+'>>')
out('endobj')
end
def GetStringWidth(s)
- if(@CurrentFont['type']=='Type0')
+ if(@current_font['type']=='Type0')
return GetSJISStringWidth(s)
else
return super(s)
def GetSJISStringWidth(s)
#SJIS version of GetStringWidth()
l=0
- cw=@CurrentFont['cw']
+ cw=@current_font['cw']
nb=s.length
i=0
while(i<nb)
i+=2
end
end
- return l*@FontSize/1000
+ return l*@font_size/1000
end
def MultiCell(w,h,txt,border=0,align='L',fill=0)
- if(@CurrentFont['type']=='Type0')
+ if(@current_font['type']=='Type0')
SJISMultiCell(w,h,txt,border,align,fill)
else
super(w,h,txt,border,align,fill)
def SJISMultiCell(w,h,txt,border=0,align='L',fill=0)
#Output text with automatic or explicit line breaks
- cw=@CurrentFont['cw']
+ cw=@current_font['cw']
if(w==0)
- w=@w-@rMargin-@x
+ w=@w-@r_margin-@x
end
- wmax=(w-2*@cMargin)*1000/@FontSize
+ wmax=(w-2*@c_margin)*1000/@font_size
s=txt.gsub("\r",'')
nb=s.length
if(nb>0 and s[nb-1]=="\n")
b+='B'
end
Cell(w,h,s[j,i-j],b,2,align,fill)
- @x=@lMargin
+ @x=@l_margin
end
def Write(h,txt,link='')
- if(@CurrentFont['type']=='Type0')
+ if(@current_font['type']=='Type0')
SJISWrite(h,txt,link)
else
super(h,txt,link)
def SJISWrite(h,txt,link)
#SJIS version of Write()
- cw=@CurrentFont['cw']
- w=@w-@rMargin-@x
- wmax=(w-2*@cMargin)*1000/@FontSize
+ cw=@current_font['cw']
+ w=@w-@r_margin-@x
+ wmax=(w-2*@c_margin)*1000/@font_size
s=txt.gsub("\r",'')
nb=s.length
sep=-1
l=0
if(nl==1)
#Go to left margin
- @x=@lMargin
- w=@w-@rMargin-@x
- wmax=(w-2*@cMargin)*1000/@FontSize
+ @x=@l_margin
+ w=@w-@r_margin-@x
+ wmax=(w-2*@c_margin)*1000/@font_size
end
nl+=1
next
if(l>wmax)
#Automatic line break
if(sep==-1 or i==j)
- if(@x>@lMargin)
+ if(@x>@l_margin)
#Move to next line
- @x=@lMargin
+ @x=@l_margin
@y+=h
- w=@w-@rMargin-@x
- wmax=(w-2*@cMargin)*1000/@FontSize
+ w=@w-@r_margin-@x
+ wmax=(w-2*@c_margin)*1000/@font_size
i+=n
nl+=1
next
j=i
l=0
if(nl==1)
- @x=@lMargin
- w=@w-@rMargin-@x
- wmax=(w-2*@cMargin)*1000/@FontSize
+ @x=@l_margin
+ w=@w-@r_margin-@x
+ wmax=(w-2*@c_margin)*1000/@font_size
end
nl+=1
else
end
#Last chunk
if(i!=j)
- Cell(l/1000*@FontSize,h,s[j,i-j],0,0,'',0,link)
+ Cell(l/1000*@font_size,h,s[j,i-j],0,0,'',0,link)
end
end
end
# mqr=get_magic_quotes_runtime()
# set_magic_quotes_runtime(0)
- @FontFiles.each_pair do |file, info|
+ @font_files.each_pair do |file, info|
#Font file embedding
newobj()
- @FontFiles[file]['n']=@n
+ @font_files[file]['n']=@n
if(defined('FPDF_FONTPATH'))
file=FPDF_FONTPATH+file
end
end
file=font['file']
if(file)
- s+=' /FontFile'+(font['type']=='Type1' ? '' : '2')+' '+@FontFiles[file]['n']+' 0 R'
+ s+=' /FontFile'+(font['type']=='Type1' ? '' : '2')+' '+@font_files[file]['n']+' 0 R'
end
out(s+'>>')
out('endobj')
end\r
\r
def GetStringWidth(s)\r
- if(@CurrentFont['type']=='Type0')\r
+ if(@current_font['type']=='Type0')\r
return GetMBStringWidth(s)\r
else\r
return super(s)\r
def GetMBStringWidth(s)\r
#Multi-byte version of GetStringWidth()\r
l=0\r
- cw=@CurrentFont['cw']\r
+ cw=@current_font['cw']\r
nb=s.length\r
i=0\r
while(i<nb)\r
i+=2\r
end\r
end\r
- return l*@FontSize/1000\r
+ return l*@font_size/1000\r
end\r
\r
def MultiCell(w,h,txt,border=0,align='L',fill=0)\r
- if(@CurrentFont['type']=='Type0')\r
+ if(@current_font['type']=='Type0')\r
MBMultiCell(w,h,txt,border,align,fill)\r
else\r
super(w,h,txt,border,align,fill)\r
\r
def MBMultiCell(w,h,txt,border=0,align='L',fill=0)\r
#Multi-byte version of MultiCell()\r
- cw=@CurrentFont['cw']\r
+ cw=@current_font['cw']\r
if(w==0)\r
- w=@w-@rMargin-@x\r
+ w=@w-@r_margin-@x\r
end\r
- wmax=(w-2*@cMargin)*1000/@FontSize\r
+ wmax=(w-2*@c_margin)*1000/@font_size\r
s=txt.gsub("\r",'')\r
nb=s.length\r
if(nb>0 and s[nb-1]=="\n")\r
b+='B'\r
end\r
Cell(w,h,s[j,i-j],b,2,align,fill)\r
- @x=@lMargin\r
+ @x=@l_margin\r
end\r
\r
def Write(h,txt,link='')\r
- if(@CurrentFont['type']=='Type0')\r
+ if(@current_font['type']=='Type0')\r
MBWrite(h,txt,link)\r
else\r
super(h,txt,link)\r
\r
def MBWrite(h,txt,link)\r
#Multi-byte version of Write()\r
- cw=@CurrentFont['cw']\r
- w=@w-@rMargin-@x\r
- wmax=(w-2*@cMargin)*1000/@FontSize\r
+ cw=@current_font['cw']\r
+ w=@w-@r_margin-@x\r
+ wmax=(w-2*@c_margin)*1000/@font_size\r
s=txt.gsub("\r",'')\r
nb=s.length\r
sep=-1\r
j=i\r
l=0\r
if(nl==1)\r
- @x=@lMargin\r
- w=@w-@rMargin-@x\r
- wmax=(w-2*@cMargin)*1000/@FontSize\r
+ @x=@l_margin\r
+ w=@w-@r_margin-@x\r
+ wmax=(w-2*@c_margin)*1000/@font_size\r
end\r
nl+=1\r
next\r
if(l>wmax)\r
#Automatic line break\r
if(sep==-1 or i==j)\r
- if(@x>@lMargin)\r
+ if(@x>@l_margin)\r
#Move to next line\r
- @x=@lMargin\r
+ @x=@l_margin\r
@y+=h\r
- w=@w-@rMargin-@x\r
- wmax=(w-2*@cMargin)*1000/@FontSize\r
+ w=@w-@r_margin-@x\r
+ wmax=(w-2*@c_margin)*1000/@font_size\r
i+=1\r
nl+=1\r
next\r
j=i\r
l=0\r
if(nl==1)\r
- @x=@lMargin\r
- w=@w-@rMargin-@x\r
- wmax=(w-2*@cMargin)*1000/@FontSize\r
+ @x=@l_margin\r
+ w=@w-@r_margin-@x\r
+ wmax=(w-2*@c_margin)*1000/@font_size\r
end\r
nl+=1\r
else\r
end\r
#Last chunk\r
if(i!=j)\r
- Cell(l/1000*@FontSize,h,s[j,i-j],0,0,'',0,link)\r
+ Cell(l/1000*@font_size,h,s[j,i-j],0,0,'',0,link)\r
end\r
end\r
\r
end\r
# mqr=get_magic_quotes_runtime()\r
# set_magic_quotes_runtime(0)\r
- @FontFiles.each_pair do |file, info|\r
+ @font_files.each_pair do |file, info|\r
#Font file embedding\r
newobj()\r
- @FontFiles[file]['n']=@n\r
+ @font_files[file]['n']=@n\r
if(defined('FPDF_FONTPATH'))\r
file=FPDF_FONTPATH+file\r
end\r
end\r
file=font['file']\r
if(file)\r
- s+=' /FontFile'+(font['type']=='Type1' ? '' : '2')+' '+@FontFiles[file]['n']+' 0 R'\r
+ s+=' /FontFile'+(font['type']=='Type1' ? '' : '2')+' '+@font_files[file]['n']+' 0 R'\r
end\r
out(s+'>>')\r
out('endobj')\r