Rails PDF Prawn Headers and Footers -


Is there any easy code to set the header and poucher on all N pages in the PDF file generated by the PRWN plugin?

Write in " report.pdf.prawn " file The code is the direct coding area of ​​the PDF view page

file report.pdf.prawn

  pdf.text code below "Creation Date" Has gone + time.now.strftime ('% D-% m-% Y') pdf.text "Page number: # {pdf.page_count}"  

What I want These values ​​have to be placed in the header or / and footers

Thanks for doing so for your concerns а lot. I wanted to do this work since I got the link.

  create_date = time.now.strftime ('% d-% m-% Y') page_count = Pdf.page_count powered_by = @companylogo # @ companylogo Administrator will get from Prawn :: Document.gen Erate ("show_sd_report_pdf.pdf" ,: skip_page_creation = & gt; true) do PDF. Page_count.times do I | Pdf.go_to_page (i + 1) pdf.draw_text "Creation Date:" + build_date, at => gt; [590,530] pdf.draw_text "Page number: # {i + 1} / # {pdf.page_count}", at: = on & gt; [1,1] pdf.draw_text "Powered by:", at: = on> [590,1] pdf.image powered_by, width = & gt; 25 ,: = & gt; [670.15] insted ** pdf.bounding_box ([1,540], width = & gt; 300 ,: height = & gt; 300) of end-end ** or draw_text ** "pdf.text" username: "+ User_name end  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -