]> source.dussan.org Git - redmine.git/commitdiff
pdf: add the new feature to include attachment images (#3261)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 24 Nov 2011 11:12:00 +0000 (11:12 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 24 Nov 2011 11:12:00 +0000 (11:12 +0000)
Contributed by Jun NAITOH.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7915 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/export/pdf.rb

index 661b4454a56828ec08fc0cd96bba5af452790313..b09f9b60d7c3c7770d8f3c4f612432054e081a44 100644 (file)
@@ -116,12 +116,23 @@ module Redmine
         end
 
         def RDMwriteHTMLCell(w, h, x, y, txt='', attachments=[], border=0, ln=1, fill=0)
+          @attachments = attachments
           writeHTMLCell(w, h, x, y,
             fix_text_encoding(
               Redmine::WikiFormatting.to_html(Setting.text_formatting, txt)),
             border, ln, fill)
         end
 
+        def getImageFilename(attrname)
+          # attrname: general_pdf_encoding string file/uri name
+          atta = RDMPdfEncoding.attach(@attachments, attrname, l(:general_pdf_encoding))
+          if atta
+            return atta.diskfile
+          else
+            return nil
+          end
+        end
+
         def Footer
           SetFont(@font_for_footer, 'I', 8)
           SetY(-15)