views:

195

answers:

2

Hi there, I have a working Prawnto implementation, except for in IE versions 6 - 8. Here's my print method:

prawnto :inline => false, :filename => @purchase.deal.name + "-" + @purchase.customer.name+".pdf", :prawn => {:skip_page_creation=>true}

This works fine on Safari, FF and Chrome. You know, the sane browsers.

But on IE, the browser attempts to download the id number of the record; the URL looks like this:

https://domain.com/customers/print/24?format=pdf

It says "cannot download file '24'".

Any idea what I should be doing here?

Thanks, Aaron.

A: 

Another solution would be to create pdf link without the SSL requirement until this gets sorted out. If you're using the ssl_requirement plugin, use ssl_allowed instead of required and then generate the link without the https.

It's not what I would like to do, but it gets the job done for now. I'm still looking into this as the other posted solution, to intercept the headers using Rack Middleware, didn't work for me.

Steve
+1  A: 

I updated my answer over here:

http://stackoverflow.com/questions/1574108/rails-pdf-generation-with-prawn-in-ie7

The middleware thing looked like it would work, but for whatever reason it didn't. We set some headers on the controller action, and that seemed to work for us.

Jeff Wigal