render :pdf => \"file_name\", :layout => \'pdf.html.erb\', :template => \'transactions/show.pdf.er
You may want to simply render the template as a string and assign it to the header's content. Try this out:
header: { content: render_to_string(template: 'header.pdf.haml') }
It works well for me.