Search Results

Search found 9 results on 1 pages for 'prawnto'.

Page 1/1 | 1 

  • setup for prawn, prawnto on heroku

    - by daniel
    I'm trying to use prawn, prawnto for generating pdfs in a rails application hosted on heroku. But I'm struggling on the setup. Is it possible to use prawn, prawnto on heroku? Is there a guide explaining what I should do? Thanks

    Read the article

  • header and footer in Prawn PDF

    - by Nik
    Hello all, I have read through all relevant posts on Prawn but found no mentioning (even in Prawn's own documentation) of headers and footers. However, I did see a demo on Prawnto's own website about headers and footers. I copied the entire source of that demo just to see if it works but an error of undefined method "header" is complained about. Am I to understand that Prawn took out header and footer recently in the gem or is there something else I need to do first to use header and footer? The demo page: http://cracklabs.com/prawnto/code/prawn_demos/source/text/flowing_text_with_header_and_footer the part of code of concern: Prawn::Document.generate("flow_with_headers_and_footers.pdf") do header margin_box.top_left do text "Here's My Fancy Header", :size = 25, :align = :center end text "hello world!" end And by header, just in case, I mean the snippets of words that appear usually at a corner of every page of a document. Like your account number in your bills pages. thanks!

    Read the article

  • Rails PDF Generation with Prawn in IE7

    - by fluid_chelsea
    I'm using Prawn and Prawnto to generate a PDF in a Ruby on Rails app (Rails version 2.2.2) which works great and generates PDFs happily and sends them to the user to download in Firefox. The problem is in IE7. I have a route set up like so: map.invoice_pdf '/invoices.pdf', :controller => 'invoices', :action => 'index', :format => 'pdf' Which I then have a link like so to call: invoice_pdf_path(:year => params[:year], :month => params[:month], :unpaid_only => params[:unpaid_only]) And the following in my controller: def index params[:year] = default params[:year] params[:month] = default params[:month] params[:page] ||= 1 @invoices = Arobl.find_invoices_for_customer(current_customer.strCustomerID, params) respond_to do |format| format.html{ render :action => 'index' } format.pdf{ prawnto :inline => false, :filename => "#{current_customer.strCustomerID}_invoice.pdf" end In FF this works as expected, when the link is clicked the show action is invoked with a format of .pdf, and responds with the correctly named PDF. When it's hit with IE7 it says that the file or website could not be found, and references "invoices.pdf" instead of the expected customer_id_invoice.pdf filename. Any idea what could be causing this behaviour? Thanks!

    Read the article

  • Prawn html formatting

    - by stevenheidel
    I have some simple lists and bold/italic text to format with prawn. How do I get prawn to pay attention to the html tags instead of just displaying them explicitly. If prawn can't do this, what are my other options?

    Read the article

  • Wrap text around an image in rails and prawn

    - by stevenheidel
    I have a document with dynamic image and dynamic text and would like the text around the image. The image is right aligned on the landscape page. Here is what I have so far: pdf.bounding_box([0,pdf.bounds.top - 50], :width => pdf.bounds.width, :height => pdf.bounds.height-50) do pdf.text @article.title, :size => 30, :style => :bold pdf.text @article.content, :align => :left # image pdf.bounding_box([pdf.bounds.right - 250, pdf.bounds.top], :width => 250, :height => 250) do pdf.image image_path, :width => 250 end end The text goes right underneath the image. I tried doing this http://stackoverflow.com/questions/2085151/ruby-prawn-how-to-wrap-text-around-an-aligned-right-image but it didn't work. Help is appreciated, thanks.

    Read the article

  • Rails and Prawn PDF - add current item ID to filename?

    - by dannymcc
    Hi Everyone, I have two PDFs that are made "on the fly" using Prawn PDF. The PDFs are called jobsheet.pdf and discharge.pdf - their URL's are: railsroot/kases/IDNO/jobsheet.pdf railsroot/kases/IDNO/discharge.pdf I am trying to work out how to automagically append the filename with the ID number: railsroot/kases/IDNO/jobsheet_IDNO.pdf railsroot/kases/IDNO/discharge_IDNO.pdf To create the PDFs the code is as follows: Kases Controller def jobsheet @kase = Kase.find(params[:id]) respond_to do |format| format.html {} # jobsheet.html.erb format.xml { render :xml => @kase } format.pdf { render :layout => false } prawnto :prawn => { :background => "#{RAILS_ROOT}/public/images/jobsheet.png", :left_margin => 0, :right_margin => 0, :top_margin => 0, :bottom_margin => 0, :page_size => 'A4' } end end # GET /kases/1 # GET /kases/1.xml def discharge @kase = Kase.find(params[:id]) respond_to do |format| format.html { } # discharge.html.erb format.xml { render :xml => @kase } format.pdf { render :layout => false } prawnto :prawn => { :background => "#{RAILS_ROOT}/public/images/discharge.png", :left_margin => 0, :right_margin => 0, :top_margin => 0, :bottom_margin => 0, :page_size => 'A4' } end end Routes map.resources :kases, :member => { :discharge => :get } map.resources :kases, :member => { :jobsheet => :get } To view the PDF's I use the following links: jobsheet_kase_path(@kase, :format => 'pdf') discharge_kase_path(@kase, :format => 'pdf') Is this even possible? Thanks, Danny

    Read the article

  • How to use rails routes in external classes?

    - by wesgarrison
    I'm using prawn to generate pdfs, set up ala http://wiki.github.com/sandal/prawn/using-prawn-in-rails I'd like to access my routes so I can generate links in my pdfs, but now I'm not in a template like I used to do with prawnto, so I don't have access to the named routes. class MyPdf < Prawn::Document def to_pdf text root_path end end How can I include my named routes?

    Read the article

  • Rails address and routes?

    - by Danny McClelland
    Hi Everyone, I have created a custom action within one of my controlers as follows: # GET /kases/discharge/1 # GET /kases/discharge/1.xml def discharge @kase = Kase.find_by_jobno(params[:id]) respond_to do |format| format.html { } # discharge.html.erb format.xml { render :xml => @kase } format.pdf { render :layout => false } prawnto :prawn => { :background => "#{RAILS_ROOT}/public/images/discharge.png", :left_margin => 0, :right_margin => 0, :top_margin => 0, :bottom_margin => 0, :page_size => 'A4' } end end For the edit actions etc the link would be link_to edit_kase_path(@kase) Is there a way of linking to the discharge action already, or do I have to make a custom route? Thanks, Danny

    Read the article

  • Generating PDF's via Delayed Job while maintaing a RESTful pattern.

    - by Jeff
    Hi, currently I am running a Rails app on Heroku, and everything is working great with exception of generating PDF documents that sometimes contain thousands of records. Heroku has a built-in timeout of 30 seconds, so if the request takes more than 30 seconds, it's abandoned. That's fine, since they offer delayed_job support built-in. However, all of the PDF's i generate follow a typical restful pattern. For instance, a request to "/posts.pdf" generates a pdf (using PRAWN and PRAWNTO) and it's delivered to the browser. So my basic question is, how do I create dynamically generated PDF's with delayed_job while maintaining the basic RESTful patterns Rail's so conveniently provides. Thanks.

    Read the article

1