我正在使用WickedPdf.new.pdf_from_string
. 文件本身生成良好,当保存在磁盘中并打开时。
但是,当通过 发送相同的文件时send_data
,浏览器会根据生成的文件下载带有页面的文件,但其中没有任何文本/内容。所有页面都是空白的。这是代码片段
send_data File.open(pdf_file.path, 'rb').read, type: 'application/pdf', filename: 'abc.pdf'
我也试过send_file
没有任何成功。
环境变量
Rails Version: 4.2.8
Ruby Version: 2.3.3
WickedPdf Ver: 1.1.0