Defect #42262
open
Tried to edit a simple text to issues_pdf_helper.rb but didn't take effect
Added by help redmine 10 days ago.
Updated 9 days ago.
Description
Tried to edit a simple text to issues_pdf_helper.rb but didn't take effect, please help
- Status changed from New to Needs feedback
Please be much more specific.
- What exactly have you tried? Please describe your intentions and any code you have written.
- What did you do with this code? Describe how you use your changes (e.g. how you call or use this, including any required data)
- What did you expect to happen?
- What didn't work? Show any errors you get in full including all stack traces. Describe what you see and be specific in which way this is not what you would have expected.
I attempted to modify the issue_to_pdf method in issues_pdf_helper.rb to verify if my changes were being applied. Specifically, I added a test text "TESTING" to the generated PDF to confirm that modifications were taking effect.
I just tried to add some text in the PDF to see if it will take affect
def issue_to_pdf(issue, assoc={})
pdf = ITCPDF.new(current_language)
pdf.set_title("#{issue.project} - #{issue.tracker} ##{issue.id}")
pdf.alias_nb_pages
pdf.footer_date = format_date(User.current.today)
pdf.add_page
pdf.SetFontStyle('B', 11)
buf = "#{issue.project} - #{issue.tracker} ##{issue.id}"
pdf.RDMMultiCell(190, 5, buf)
# Test Text
pdf.SetFontStyle('B', 10) # ADDED THIS LINE
pdf.RDMMultiCell(190, 5, "TESTING", 0, 'C') # ADDED THIS LINE
pdf.SetFontStyle('', 8)
base_x = pdf.get_x
i = 1
issue.ancestors.visible.each do |ancestor|
pdf.set_x(base_x + i)
buf = "#{ancestor.tracker} # #{ancestor.id} (#{ancestor.status}): #{ancestor.subject}"
pdf.RDMMultiCell(190 - i, 5, buf)
i += 1 if i < 35
end
<-- Rest of the code -->
Also available in: Atom
PDF