Is there any options to customize stroke_bounds? (Rails Prawn)

流过昼夜 提交于 2019-12-22 10:36:19

问题


I want to draw borders for all the pages in my PDF. But while using stroke_bounds, I can only draw single dark lined borders alone. I couldn't customize anything?

Does anybody have any idea on how to change the style of my stroke_bounds borders?


回答1:


Use dash in Prawn::Graphics::Dash http://prawn.majesticseacreature.com/docs/0.11.1/Prawn/Graphics/Dash.html

example:

pdf.dash 10, :space => 4
pdf.stroke_bounds



回答2:


I had the same problem. I found out that you can use the "stroke_color" function to change this color.

http://prawnpdf.org/docs/0.11.1/Prawn/Graphics/Color.html#method-i-stroke_color

stroke_color "FF0000"
stroke_bounds


来源:https://stackoverflow.com/questions/3958262/is-there-any-options-to-customize-stroke-bounds-rails-prawn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!