Mercurial > hg > soundsoftware-site
comparison lib/redmine/export/pdf.rb @ 1294:3e4c3460b6ca redmine-2.2
Update to Redmine SVN revision 11972 on 2.2-stable branch
author | Chris Cannam |
---|---|
date | Fri, 14 Jun 2013 09:01:12 +0100 |
parents | 433d4f72a19b |
children | 622f24f53b42 261b3d9a4903 |
comparison
equal
deleted
inserted
replaced
1115:433d4f72a19b | 1294:3e4c3460b6ca |
---|---|
107 | 107 |
108 def fix_text_encoding(txt) | 108 def fix_text_encoding(txt) |
109 RDMPdfEncoding::rdm_from_utf8(txt, l(:general_pdf_encoding)) | 109 RDMPdfEncoding::rdm_from_utf8(txt, l(:general_pdf_encoding)) |
110 end | 110 end |
111 | 111 |
112 def formatted_text(text) | |
113 html = Redmine::WikiFormatting.to_html(Setting.text_formatting, text) | |
114 # Strip {{toc}} tags | |
115 html.gsub!(/<p>\{\{([<>]?)toc\}\}<\/p>/i, '') | |
116 html | |
117 end | |
118 | |
112 def RDMCell(w ,h=0, txt='', border=0, ln=0, align='', fill=0, link='') | 119 def RDMCell(w ,h=0, txt='', border=0, ln=0, align='', fill=0, link='') |
113 Cell(w, h, fix_text_encoding(txt), border, ln, align, fill, link) | 120 Cell(w, h, fix_text_encoding(txt), border, ln, align, fill, link) |
114 end | 121 end |
115 | 122 |
116 def RDMMultiCell(w, h=0, txt='', border=0, align='', fill=0, ln=1) | 123 def RDMMultiCell(w, h=0, txt='', border=0, align='', fill=0, ln=1) |
118 end | 125 end |
119 | 126 |
120 def RDMwriteHTMLCell(w, h, x, y, txt='', attachments=[], border=0, ln=1, fill=0) | 127 def RDMwriteHTMLCell(w, h, x, y, txt='', attachments=[], border=0, ln=1, fill=0) |
121 @attachments = attachments | 128 @attachments = attachments |
122 writeHTMLCell(w, h, x, y, | 129 writeHTMLCell(w, h, x, y, |
123 fix_text_encoding( | 130 fix_text_encoding(formatted_text(txt)), |
124 Redmine::WikiFormatting.to_html(Setting.text_formatting, txt)), | |
125 border, ln, fill) | 131 border, ln, fill) |
126 end | 132 end |
127 | 133 |
128 def getImageFilename(attrname) | 134 def getImageFilename(attrname) |
129 # attrname: general_pdf_encoding string file/uri name | 135 # attrname: general_pdf_encoding string file/uri name |