Created
November 3, 2009 05:20
-
-
Save co-hack/224821 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def wrap_it(&block) | |
new_pdf = ConsoloPdf.new | |
beginning_y = new_pdf.y | |
yield new_pdf | |
new_pdf_height = beginning_y - new_pdf.y | |
self.start_new_page if self.y < new_pdf_height | |
yield self | |
end | |
## to use | |
pdf.wrap_it do |group| | |
group.h1 "Some Header info" | |
## display table is a helper that I have created | |
group.display_table(other_clinical_data) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment