加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 无法在对虾中绘制边界框边框

发布时间:2020-12-17 02:09:37 所属栏目:百科 来源:网络整理
导读:如何使用特定设置在边界框周围绘制边框 bounding_box([175,starting_y - 190],:width = 30.mm,:height = 17.mm) do stroke_color 'FFFF00' dash 10,space: 4 stroke_boundsend 我想单独为底部点缀边框,我将如何拥有它? 我尝试在中风,stroke_bounds,对虾文件
如何使用特定设置在边界框周围绘制边框

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中搜索,我找不到任何东西

解决方法

您可以单独绘制线条:

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,:at => x+width
    horizontal_line x,x+width,:at => y+height
  end

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

它输出

enter image description here

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读