I am generating a pdf file using WickedPdf.new.pdf_from_string
. File itself generates fine, when saved in disk and opened.
But when same file sent via send_data
, browser downloads file with pages as per generated file but without any text/content in it. All pages are blank. Here is code snippet
send_data File.open(pdf_file.path, 'rb').read, type: 'application/pdf', filename: 'abc.pdf'
I have also tried send_file
without any success.
Environment vars
Rails Version: 4.2.8
Ruby Version: 2.3.3
WickedPdf Ver: 1.1.0