rails gem prawn, image and anchor

前端 未结 2 1784
清酒与你
清酒与你 2021-02-14 21:29

Can you tell me how to insert image which will be a link to for example page 20? I know how to make with normal text:

text \"Go to          


        
2条回答
  •  情话喂你
    2021-02-14 21:50

    Prawn does not support this functionality. In fact, even if you placed a formatted_text_box over an image and fill it with white space, it still will not work. An anchor has to include text to work. If you don't mind having text over your image, then that might be a solution.

    Prawn's own readme states:

    One thing Prawn is not, and will never be, is an HTML to PDF generator.

    After dealing with many of Prawn's shortcomings, I've switched to using wicked_pdf for my Ruby on Rails PDF generation and have been very happy with it. If you can do it in html & css, it can be done with wicked_pdf.

提交回复
热议问题