lib/resumetools/resume/pdf.rb in resumetools-1.0.1 vs lib/resumetools/resume/pdf.rb in resumetools-1.0.2

- old
+ new

@@ -41,11 +41,11 @@ :period => 10 } DATE_FORMAT = "%B, %Y" # Render to PDF - def render_pdf(opts={}) + def render_pdf(opts={}, &blk) default_font = opts.delete(:default_font) || "SourceSansPro" pdf = Prawn::Document.new( :info => {}, :top_margin => MARGINS[0].in, @@ -131,9 +131,14 @@ }) end end end end + end + + if blk + result = { pages: pdf.page_count } + yield result end pdf.render end