Using lists in prawn

2019-03-25 15:14发布

Im using prawn to create pdfs that contain much data in table format and some lists. The problem with the lists is that Im just using text as lists because there is no semantic equivalent to ul > li lists like I use them in the webfrointend. So the lists arent justified. A list point that uses more than one line looks creapy because I doesnt fit the list icon. How can I implement lists in prawn that dont look like crap?

7条回答
男人必须洒脱
2楼-- · 2019-03-25 15:50

Prawn was a good PDF library but the problem is its own view system. There is Prawn-format but is not maintained anymore.

I suggest to use WickedPDF, it allows you to include simple ERB code in your PDF.

Using Prawn: another dirty and ugly solution is a two column table without border, first column contains list-bullet, second column text:

table([ ["•", "First Element"],
        ["•", "Second Element"],
        ["•", "Third Element"] ])
查看更多
登录 后发表回答