我有一個應用程序,其中將我的瀏覽器中的Fedex標籤顯示爲PDF。Ruby send_data在瀏覽器中將數組呈現爲PDF
我已經使用send_data
呈現每個標籤如下,它完美的作品:
@label_image = Base64.decode64(image_hex).html_safe #image_hex is a text field where I store the label in db
send_data @label_image, :type => 'application/pdf', :disposition => 'inline', :filename => 'test.pdf'
但是,我想渲染多個標籤在類似的方式,即我可以有標籤say @labels_images
的數組,在一個請求中將它們呈現給瀏覽器。
PDF的每一頁應該有一個標籤。
我該如何使用send_data
或其他任何可用的庫來做到這一點?
感謝
感謝您的答覆,我用combine_pdf寶石得到這個工作! – dp7