Issues with send_file for pdf file in rails

803 views Asked by At

I am using pdftk for generating PDF. After generating it, I want to open that PDF file in my browser. Here is code that I have used for pdf open in browser:

send_file(params[:myfile], :filename => "test.pdf", :type => 'application/pdf', :disposition => 'inline')

In this, params[:myfile] is path of the PDF file where it is stored.

My issue is when I execute this code, it opens file in new window with table structure but is not showing any content in that PDF file

I dont want to open the PDF as an attachment.

Please give your positive suggestion.

0

There are 0 answers