Reputation: 101
I have added header using: %meta{:name => 'pdfkit-header_html', :content => pdf_header_url}
But I need header only on first page and not on the other pages. Also, I need different header_spacing on the first page and other pages. Please, suggest how to do this?
Upvotes: 1
Views: 568
Reputation: 101
%html
%head
%meta{:name => 'pdfkit-header_html', :content => pdf_header_url }
Now in the pdf_header action the params[:page] will be available
def pdf_header
if params[:page] == 1
render 'pdf_header'
else
render nothing: true
end
end
Upvotes: 1