Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 无法在对虾中绘制边界框边框_Ruby On Rails_Ruby_Prawn - Fatal编程技术网

Ruby on rails 无法在对虾中绘制边界框边框

Ruby on rails 无法在对虾中绘制边界框边框,ruby-on-rails,ruby,prawn,Ruby On Rails,Ruby,Prawn,如何使用特定设置在边界框周围绘制边框 bounding_box([175, starting_y - 190], :width => 30.mm, :height => 17.mm) do stroke_color 'FFFF00' dash 10, space: 4 stroke_bounds end 我想有边界点为底部单独,我将如何有这个 我试着在stroke,stroke_bounds,bounding_box of prawn文档中搜索,我找不到任何东西你可以分

如何使用特定设置在边界框周围绘制边框

bounding_box([175, starting_y - 190], :width => 30.mm, :height => 17.mm) do
  stroke_color 'FFFF00'
  dash 10, space: 4
  stroke_bounds
end
我想有边界点为底部单独,我将如何有这个


我试着在stroke,stroke_bounds,bounding_box of prawn文档中搜索,我找不到任何东西

你可以分别画线:

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
它输出


您想要一条虚线,还是三条连续线和一条虚线?