Fixes gantt PDF pagination problem (#6348).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4474 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2010-12-07 18:53:15 +00:00
parent b17e145d75
commit 9c6377964c
1 changed files with 13 additions and 1 deletions

View File

@ -246,6 +246,7 @@ module Redmine
options[:image].stroke_width(1) options[:image].stroke_width(1)
options[:image].text(options[:indent], options[:top] + 2, project.name) options[:image].text(options[:indent], options[:top] + 2, project.name)
when :pdf when :pdf
pdf_new_page?(options)
options[:pdf].SetY(options[:top]) options[:pdf].SetY(options[:top])
options[:pdf].SetX(15) options[:pdf].SetX(15)
@ -381,6 +382,7 @@ module Redmine
options[:image].stroke_width(1) options[:image].stroke_width(1)
options[:image].text(options[:indent], options[:top] + 2, version.to_s_with_project) options[:image].text(options[:indent], options[:top] + 2, version.to_s_with_project)
when :pdf when :pdf
pdf_new_page?(options)
options[:pdf].SetY(options[:top]) options[:pdf].SetY(options[:top])
options[:pdf].SetX(15) options[:pdf].SetX(15)
@ -535,6 +537,7 @@ module Redmine
options[:image].stroke_width(1) options[:image].stroke_width(1)
options[:image].text(options[:indent], options[:top] + 2, issue.subject) options[:image].text(options[:indent], options[:top] + 2, issue.subject)
when :pdf when :pdf
pdf_new_page?(options)
options[:pdf].SetY(options[:top]) options[:pdf].SetY(options[:top])
options[:pdf].SetX(15) options[:pdf].SetX(15)
@ -921,7 +924,7 @@ module Redmine
:g_width => g_width, :g_width => g_width,
:indent => 0, :indent => 0,
:indent_increment => 5, :indent_increment => 5,
:top_increment => 3, :top_increment => 5,
:format => :pdf, :format => :pdf,
:pdf => pdf :pdf => pdf
} }
@ -943,6 +946,15 @@ module Redmine
cmp cmp
end end
end end
def pdf_new_page?(options)
if options[:top] > 180
options[:pdf].Line(15, options[:top], PDF::TotalWidth, options[:top])
options[:pdf].AddPage("L")
options[:top] = 15
options[:pdf].Line(15, options[:top] - 0.1, PDF::TotalWidth, options[:top] - 0.1)
end
end
end end
end end
end end