I'm building a PDF export function in Rails and Prawn where I want to export a number of "Companies" in one single PDF. A company usually flows over 2-3 pages. Right now when exporting a single Company this works with a pdf.repeat(:all). I want the logo to change in the header based on the Company though. A simple code example is:
@companies.each do |c|
pdf.repeat(:all) do
pdf.image company.logo.url(:thumb), :at => [0,520]
end
end
Is there a way of doing this? I have looked at related topics, like header and footer in Prawn PDF but it won't help me since I can't see what Company belongs to which page after it's generated.