i have requirement create pdfs tables. started using prawn. slow , kept utilizing 100% cpu. moved wicked_pdf.
this faster prawn still faster. 1 of friend recommended tcpdf.
i found rfpdf gem tcpdf plugin rails. have here used before? how fast it?
i found fpdf. better wicked_pdf?
you can use 'wicked_pdf' gem. provides support generate pdf using html code. https://github.com/mileszs/wicked_pdf
in controller:
def show @report = report.find(params[:id]) respond_to |format| format.html # show.html.erb format.pdf render :pdf => "report",:template => "reports/show" end end end create show.pdf.erb , can write simple html.
<%= wicked_pdf_stylesheet_link_tag "application" %> <h1> report </h1> <p> <%= @report.details %> ................................. </p>
Comments
Post a Comment