2016-12-26 68 views
4

我如何绘制边框边框与特定的设置不能得出边框边框对虾

bounding_box([175, starting_y - 190], :width => 30.mm, :height => 17.mm) do 
    stroke_color 'FFFF00' 
    dash 10, space: 4 
    stroke_bounds 
end 

我想有边框点缀单独底,我怎么有这个?

我试着在行程搜索,stroke_bounds,对虾文件bounding_box,我找不到任何

+0

你只需要一条虚线,还是3条连续线和1条虚线? –

回答

1

您可以单独绘制线条:

require "prawn" 

Prawn::Document.generate("bbox.pdf") do 
    x = 175 
    y = 200 
    width = 100 
    height = 50 
    color = 'FFFF00' 

    stroke do 
    stroke_color color 
    vertical_line y, y+height, :at => x 
    vertical_line y, y+height, :at => x+width 
    horizontal_line x, x+width, :at => y+height 
    end 

    stroke do 
    stroke_color color 
    dash 10, space: 4 
    horizontal_line x, x+width, :at => y 
    end 
end 

它输出

enter image description here